> How can I stop the "returns successfully" messages from the exec {}
> type unless their is a failure? Don't really want to see it. Using
> logoutput => on_failure with exec doesn't seem to work (as this person
> says 
> herehttp://unimpressed.org/post/93835992/disabling-puppets-executed-succe...).
> I also tried that however, with:
>
>     exec {
>         "dummy-passwd-${name}":
>             command => "cat /etc/passwd | grep \"^${name}\" >
> /var/sftp/chroot/${name}/etc/passwd",
>             onlyif => "test /var/sftp/chroot/${name}/etc",
>             logoutput => on_failure,
>             tag => bitbucket;
>     }

Use 'unless' instead of 'onlyif' ... you want to run the command
_unless_ the test returns positive (ie. the file exists). In your
case, its running each time so the behaviour is correct (but not as
you expect). You could also use 'creates' instead:

exec {"dummy-password-${name}":
  command => "cat /etc/passwd | grep \"^${name}\" > /var/sftp/chroot/$
{name}/etc/passwd",
  creates => "/var/sftp/chroot/${name}/etc"
}

Consult the reference docs for all the parameters and behaviour for
exec: http://docs.puppetlabs.com/references/stable/type.html#exec

ken.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to