Puppet won't execute command

Posted by tom on Server Fault See other posts from Server Fault or by tom
Published on 2012-09-13T10:44:57Z Indexed on 2012/09/16 3:40 UTC
Read the original article Hit count: 484

Filed under:

Puppet 0.25.4 on ubuntu point blank refuses to execute the following command:

exec {"initiate replica set":
    command => "echo 'rs.initiate()' | mongo",
    path => ["/usr/bin","/usr/sbin","/bin"],
    user => "root",
    require => Class["mongodb"]
}

I can execute the command as root myself, so I'm guessing perhaps it's an issue with the shell. Unfortunately upgrading puppet isn't an option (and causes other issues anyway).

I've tried specifying explicit paths to the binaries instead of relying on the path parameter, and also changing the command to:

"bash -c \"echo 'rs.initiate()' | mongo\""

Still doesn't work.

Any ideas?

I get an error message saying something like "failed to change from notrun to 0"

© Server Fault or respective owner

Related posts about puppet