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 [email protected]
> (mailto:[email protected]).
> To unsubscribe from this group, send email to
> [email protected]
> (mailto:[email protected]).
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.