My requirement is, I want to execute a shell script with puppet?
I Tried below code it did not work:-
class mymodule::myklass{
file {
'my_bash_script':
ensure => 'file',
source => 'puppet:///modules/mymodule/showip.sh',
path => '/etc/puppet/modules/mymodule/showip.sh',
owner => 'root',
group => 'root',
mode => '0755', # Use 0700 if it is sensitive
notify => Exec['run_my_script'],
}
exec {
'run_my_script':
#path => ["/usr/bin", "/usr/sbin", "/bin/bash"],
command => '/etc/puppet/modules/mymodule/showip.sh',
refreshonly => true
}
}
Thanks,viki
↧