-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow exec
creates
to check for all files instead of at least one
#9168
Comments
Discussing on Slack, another option that preserves backwards compatibility would be to take a multi-dimensional array:
|
exec
creates
to check for all files instead of at least oneexec
creates
to check for all files instead of at least one
Migrated issue to PUP-11989 |
@yakatz I'm confused. The puppet/lib/puppet/type/exec.rb Lines 490 to 491 in 82ad86e
In your example, that means puppet/lib/puppet/type/exec.rb Line 445 in 82ad86e
In this example, note how both execs don't run if I just delete one of their related files:
It's only when I delete both files that the execs run:
|
It might have been a copy/paste error - I don't have it in front of me now to check, but it is working as described in production: we have a condition that will have the exec run if either file is missing and it would be nice to natively support that. |
@yakatz could you provide steps to reproduce. |
You're right, it probably never worked that way. At some point we changed it to a single unless test for both files. unless => '/usr/bin/test -f /etc/pki/tls/certs/localhost.crt && /usr/bin/test -f /etc/pki/tls/private/localhost.key' |
@yakatz ok thanks for letting us know. So IIUC we can close this? Please reopen if I'm confused. |
It would still be a useful feature to have, so consider it a feature request. |
Given there's already a way to check that all files must exist using:
I'd be reluctant to add more complexity to the |
You can't do that, as I mentioned, my original post was wrong and we use a ridiculous shell boolean test. |
Describe the Bug
I tried to convert an
exec
resource from multiple invocations oftest -f
to use the built-increates
option, but it doesn't work as expected, it will not execute unless none of the files are present.Original:
Expected equivalent:
Debug output if both exist:
Debug output if the first file is missing and the second one exists:
Debug output if neither file exists (debug run without
notify httpd
):Expected Behavior
I would expect the command to be executed if any of the files listed in
creates
are missing.Environment
The text was updated successfully, but these errors were encountered: