Reputation: 1235
I have PHP's composer installed globally, and I'm trying to get Puppet to automatically run the composer self-update command.
Here's my manifest:
exec { "composer self-update":
path => '/usr/local/bin/'
}
Running "/usr/local/bin/composer self-update" as root manually works, but when puppet runs it generates this error:
change from notrun to 0 failed: /usr/bin/env: php: No such file or directory
I'm at a loss as to why the manual behavior is different from the Puppet behavior.
Also, I have Puppet running as root.
Upvotes: 4
Views: 1073
Reputation: 11489
Running the way you have written should have worked. Nevertheless, you can use the command
parameter :
exec { "do_some_update" :
command => "composer self-update",
path => "/usr/local/bin",
}
This way you can refer to the exec
at a later time if you want by :
file { "configuration" :
require => Exec["do_some_update"]
}
rather than typing Exec["/usr/local/bin/composer self-update"]
Upvotes: 1
Reputation: 1235
I was able to solve it myself by changing the exec. I'm not sure why there's a difference, but this works:
exec { "/usr/local/bin/composer self-update":}
Note the difference is that the path is included in the exec name instead of the path parameter. If anyone knows why it didn't work the other way, that may be informative.
Upvotes: 1