Thanks but it couldn't work though i got the message that shell script is successfully executed.
On Fri, Jun 17, 2011 at 2:44 PM, Luke Bigum <luke.bi...@lmax.com> wrote: > Annie, > > http://docs.puppetlabs.com/references/stable/type.html#exec > > By default the expected return code is probably zero, your script is > returning 1. Whether this is correct or not I don't know, but you can > tell puppet to expect a different return code: > > exec { '/etc/shell_file': > require => File['/etc/shell_file'], > returns => 1, > } > > On Jun 17, 2:36 pm, Annie Rana <annier...@gmail.com> wrote: > > I apologize for posting wrong log messages, here is the correct log: > > > > notice: Starting catalog run > > notice: //File[/tmp/QoS/QoS.sh]/ensure: created > > err: //Exec[/tmp/QoS/QoS.sh]/returns: change from notrun to 0 failed: > > /tmp/QoS/QoS.sh returned 1 instead of 0 at > /etc/puppet/manifests/site.pp:10 > > notice: Finished catalog run in 0.46 seconds > > > > Any help please? > > > > On Fri, Jun 17, 2011 at 2:09 PM, Annie Rana <annier...@gmail.com> wrote: > > > Hi Peter, thanks for your reply. I managed to copy the shell file > puppet > > > client using the file resource recipe you specified but exec is > throwing an > > > error, which is as follows: > > > > > info: No classes to store > > > info: Caching catalog at /var/lib/puppet/state/localconfig.yaml > > > notice: Starting catalog run > > > err: //File[/tmp/QoS/QoS.sh]/ensure: change from absent to file failed: > > > Could not set file on ensure: No such file or directory - > > > /tmp/QoS/QoS.sh.puppettmp at /etc/puppet/manifests/site.pp:7 > > > notice: //Exec[/tmp/QoS/QoS.sh]: Dependency file[/tmp/QoS/QoS.sh] has 1 > > > failures > > > warning: //Exec[/tmp/QoS/QoS.sh]: Skipping because of failed > dependencies > > > notice: Finished catalog run in 0.38 seconds > > > > > When I tried running the shell script manually using the following > command > > > > > '/tmp/QoS/QoS.sh; echo $?' > > > > > , it worked fine printing 0 at the end. Any help what is wrong with > exec > > > resource recipe? > > > > > Thanks in advance for your time. > > > > > Regards, > > > > > A. > > > > > On Thu, Jun 16, 2011 at 8:42 PM, Peter Bukowinski <pmb...@gmail.com > >wrote: > > > > >> It sounds like you haven't set up the puppet fileserver yet. Choose a > > >> directory that will hold files you want to copy to clients. I use > > >> /opt/files, so that's what is in my example. Create fileserver.conf in > the > > >> same directory as puppet.conf and add these lines: > > > > >> [files] > > >> path /opt/files > > >> allow *.client.domain > > > > >> Put your shell file in the path you specified. Now you just need to > set up > > >> a file and exec resource. Note the source item in the file resource > and the > > >> require item in exec. > > > > >> file { '/etc/shell_file': > > >> ensure => present, > > >> owner => 'root', > > >> group => 'root', > > >> mode => '0755', > > >> source => 'puppet://puppet/files/shell_file', > > >> } > > > > >> exec { '/etc/shell_file': require => File['/etc/shell_file'] } > > > > >> -- > > >> Peter M. Bukowinski > > >> Systems Engineer > > >> Janelia Farm Research Campus, HHMI > > > > >> On Thursday, June 16, 2011 at 3:17 PM, annierana wrote: > > > > >> > Hi all, I am new to puppet. I need a sample recipe to write/copy a > > >> > shell file on puppet client. The shell file exists on puppet server. > > >> > Once the file is written, I also want to execute it. I have tried > > >> > using file resource with ensure command to copy at /etc but > permission > > >> > was denied and moreover with a different directory path (\tmp) it > just > > >> > created an empty file. Can anyone please help? > > > > >> > Regards, > > > > >> > A. > > > > >> > -- > > >> > 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 > (mailto: > > >> puppet-users@googlegroups.com). > > >> > To unsubscribe from this group, send email to > > >> puppet-users+unsubscr...@googlegroups.com (mailto: > > >> puppet-users+unsubscr...@googlegroups.com). > > >> > For more options, visit this group at > > >>http://groups.google.com/group/puppet-users?hl=en. > > > > >> -- > > >> 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. > > > > > > -- > 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. > > -- 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.