How can I get the result of an action and use it conditionally in my code?
As a very simple example:
package { "wget" : ensure => 'present' }
# if that failed, do X
To put this in context, some actual use cases I have:
- attempt to register an agent to a remote service and if that fails, open
a ticket via an API so it can be manually resolved
- attempt to create an LV and if that fails, call another module that adds
some new LUNs to my host, extend VG etc...
- ensure some critical service is running, but in case of any error raise
an alert via the standard alert API
- when applying some security-related code, confirm success/failure to a
compliance product API
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/76768f18-e11c-4d1e-84ae-49c9e41da754%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.