exec { "hammer execution":
command => "hammer architecture create --name x86_64 \
&& hammer environment create --name cloudbox",
path => "/usr/local/bin/",
require => [
File["/var/log/foreman/hammer.log"],
File["/etc/foreman/cli_config.yml"],
Package["hammer_cli_foreman"],
],
# onlyif => "hammer architecture list | /bin/grep 'x86_64' | /usr/bin/wc -l",
onlyif => "/bin/echo 1",
user => ccka,
environment => ["HOME=/home/ccka"],
}
Onliif looks at exit code, not at echo value.
If you are piping - it will be exit code of the last command.
Use grep -q or something to get a non-zero code
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b44c8522-14e2-48a0-9459-7a2a6b0c3721%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.