I'm new to using puppet, and have a master and agent server set up. I'm having difficulty figuring out how to run a python script on the agent server.
I've followed the quick start guide and have been searching for an answer, but I can't find a clear explanation.
Currently, my site.pp has:
node default {
class { 'helloworld':}
class { 'helloworld::motd':}
include python
class { 'pythontest':}
}
the init.pp in pythontest's manifest folder has:
class pythontest {
exec {'python etc/puppetlabs/code/environments/production/modules/pythontest/print.py':
require => File['etc/puppetlabs/code/environments/production/modules/pythontest/print.py']
}
}
Both are running Ubuntu 15.04
So far, Hello world is displayed, and the python module gets installed (https://forge.puppet.com/stankevich/python).
I get the error:
Error: Failed to apply catalog: Validation of Exec[etc/puppetlabs/code/environments/production/modules/pythontest/print.py] failed: 'etc/puppetlabs/code/environments/production/modules/pythontest/print.py' is not qualified and no path was specified. Please qualify the command or specify a path. at etc/puppetlabs/code/environments/production/pythontest/manifests/init.pp:2
I think I can't just put exec : python pathname, but some google searches finds some people using that method.