The generate function inside this exec runs without regard for the exit status in onlyif. I have tried the same thing with unless and generate always executes, regardless of exit code.
exec { "execute_command_on_master":
path => [ "/bin/", "/usr/bin/", ],
onlyif => "/bin/false",
command => generate("/tmp/test.sh"),
}
Here is the test script:
> cat /tmp/test.sh
#!/bin/bash
/bin/echo `date` >> /tmp/testfile
Is this expected behavior?
Thanks.
↧