On Wednesday, April 29, 2015 at 9:20:37 AM UTC-5, Jacob W. wrote:
Those messages say that you're getting the 'posix' provider for your Exec resource, and they suggest that your script is not recognized as having a valid format (per execve(2) and the related exec-family functions). But your script *does* appear to have a valid format, inasmuch as it starts with a shebang line that ought to be valid, and execve() handles that.
Usually when a program succeeds when run directly but fails when run from Puppet, the problem is related to environment (variables) or security context. The agent does provide a very sparse environment to commands it Execs (and in particular, it looks like you may want to check that `HOSTNAME` is among them). If you need additional environment variables then you provide them via
Exec's 'environment' parameter.
The error message does not look like it indicates an environment issue, however. Although you shouldn't need to do so, I'm going to suggest you try to invoke bash explicitly:
exec { '/bin/bash /tmp/ghost-test.sh':
# ...
OR
try using the 'shell' provider:
exec { '/tmp/ghost-test.sh':
provider => 'shell',
# ...
Please let us know whether one or both of those solves your problem.