Puppet Create Symlinks - Failed - plz check it

Hi All,

Task Name: Puppet Create Symlinks

I have completed the task. Like file created on all app servers but still task show failed. Kindly check on it.

Task Status - Failed
  • it seems like class ‘symlink’ is not defined properly in ‘official.pp’ on

root@stapp01 ~]# ls -ld /opt/devops
lrwxrwxrwx 1 root root 13 Aug 12 10:30 /opt/devops → /var/www/html
[root@stapp01 ~]# cd /opt/devops/
[root@stapp01 devops]# ls -l
total 0
-rw-r–r-- 1 root root 0 Aug 12 10:30 story.txt

[root@stapp02 ~]# ls -ld /opt/devops
lrwxrwxrwx 1 root root 13 Aug 12 10:30 /opt/devops → /var/www/html

[root@stapp03 ~]# ls -ld /opt/devops
lrwxrwxrwx 1 root root 13 Aug 12 10:30 /opt/devops → /var/www/html
[root@stapp03 ~]# ls -l /opt/devops
lrwxrwxrwx 1 root root 13 Aug 12 10:30 /opt/devops → /var/www/html
[root@stapp03 ~]# cd /opt/devops
[root@stapp03 devops]# ls -l
total 0
-rw-r–r-- 1 root root 0 Aug 12 10:30 story.txt

Can someone plz update on my above query

Hello, nithyaks
Can you share the puppet code of where you define class symlink line.

sh-4.2# cat init.pp
class symlink{
file { ‘/opt/finance’:
ensure => ‘link’,
target => ‘/var/www/html’,
}
file { ‘/opt/finance/blog.txt’:
ensure => present,
}
}

But in your post, error message for official.pp and you are sharing code with init.pp. It’s just an example for me right?

from official.pp i called the symlink class defined in module.

@nithyaks I think as per question you were supposed to complete this task using a single programming file for example official.pp only.

From official.pp file only I called class defined in module. I am new to puppet so I followed the procedure in some site. I have created class with the name given in question.

We can call class defined in main manifest or from module mainifest. I called the class defined in module manifest from official.pp.

@nithyaks that’s true but I think you were supposed to perform the task as per requirements mentioned in the question.