Swati Tiwari writes:
 > Hello guys,
 > 
 > I am facing this problem. I have an exec resource which has a create
 > parameter. The catalog runs properly but the file is not created, has anyone
 > faced such a problem?
 > My manifest is
 > 
 > class example
 > {
 >       exec { "sources":
 >               command => "/usr/bin/sudo /usr/bin/gem sources -a
 > http://gems.github.com";,
 >               creates => "/tmp/githubadded"
 >       }
 > }
 > 
 > The command runs fine but it does not create /tmp/githubadded file.

Then why do you have 'creates => "/tmp/githubadded"' in your class?  If
the command "/usr/sbin/sudo /usr/bin/gem sources -a
http;//gems.github.com" doesn't create the file "/tmp/githubadded", then
Puppet will run the command over and over.

Normally you use "creates" in an "exec" if you want the "exec" to run if
some specified file or directory doesn't exist, and the command run by
the "exec" needs to create the file or directory you name with "creates".

 > I also have write permission on this directory.

Note also that it is common for /tmp to be cleared out every time you
reboot a system, so if you are trying to use this to install software
for later use, this may attempt a reinstall when it is unnecessary to do
so.

 > Any help would be appreciated.  Thanks!

I also have to wonder why you use "sudo" in the command, since the
Puppet client normally runs as root, and if not run as root "sudo"
normally prompts for a password.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to