RVKS
RVKS

Reputation: 157

Puppet exec: shell command returns "could not find command"

It's the first time I'm using an exec with Puppet but I'm not sorting out why it continues returning errors. The command I'm executing consists in a series of symbolic link creations, code is:

exec { "creation_of_symbolic_links":
     command => "ln -s link1dest link1name; ln -s link2dest link2name; ... ; ln -s linkNdest linkNname",
     path => "/etc", #added just in order to delete an error
}

All linkdests and linknames are absolute paths. The error returned is:

Error: Could not find command 'ln'

Error: /Stage[main]/Main/Node[nodename]/Exec[creation_of symbolic_links]/returns: change from notrun to 0 failed: Could not find command 'ln'

How can I avoid this error?

Upvotes: 2

Views: 8194

Answers (1)

kkamil
kkamil

Reputation: 2595

Please read about the meaning of path parameter in exec resource. You got an error because path is not properly defined. Try using:

path =>  [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ]

Upvotes: 3

Related Questions