I have been trying to copy and execute a shell script residing in puppet master machine to my puppet agent
This is my code
[root@ip-****** manifests]# cat site.pp
class mymodule::myklass{
file {'my_bash_script':
ensure => 'file',
source => '/etc/puppet/modules/mymodule/my_bash_script.sh',
path => '/home/ec2-user/my_bash_script.sh',
owner => 'root',
mode => '755',
notify => Exec['run_my_script'],
}
exec { 'run_my_script':
command => '/home/ec2-user/my_bash_script.sh',
}
}
include mymodule::myklass
my script:
[root@ip-********* mymodule]# cat my_bash_script.sh
#!/bin/sh
mv /usr/bin/node /usr/bin/bnode
ln -s /usr/local/bin/node /usr/bin/node
mv /usr/bin/npm /usr/bin/bnpm
ln -s /usr/local/bin/npm /usr/bin/npm
I am getting the following error:
[root@ip-*********** /]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for ip*****************8
Info: Applying configuration version '1472235841'
Error: /Stage[main]/Mymodule::Myklass/File[my_bash_script]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/mymodule/my_bash_script.sh
Notice: /Stage[main]/Mymodule::Myklass/Exec[run_my_script]: Dependency File[my_bash_script] has failures: true
Warning: /Stage[main]/Mymodule::Myklass/Exec[run_my_script]: Skipping because of failed dependencies
Notice: Finished catalog run in 0.08 seconds
Can anyone please help me resolve this error?