On 31.07.2012 20:09, Nikolaos Hatzopoulos wrote:
> exec { "sshkeygen":
> path => "/usr/bin:/usr/sbin:/bin",
> creates => [ "puppet:///myuser/files/$username/id_rsa"
> , "puppet:///myuser/files/$username/id_rsa.pub" ],
> command =>
> generate("/bin/bash","/etc/puppet/manifests/myusers/sshkeygen.bash" )
> }
>
>
> this command does not work!! why?
>
> err: Could not retrieve catalog from remote server: wrong header line format
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
At least the following things are wrong/do not work as you seem to
expect it:
* The generate() function is run on the master while compiling the
catalog.
* The exec then tries to execute the stdout of the script on the
client.
* The "creates" parameter avoids running the command when the
specified files exist. This only checks local files and not
puppet:/// urls.
Best Regards, David