Is there a way to fail nicely (rather than do nothing, which only_if would probably provide) when certain requirements aren’t satisfied?
For example, let’s say I want to install some software, but there’s no point doing it unless a data mountpoint exists. Or I haven’t linked two playbooks together but it only makes sense to run the second after the first.
This would probably have to be based on file existence or the results of a command.
name: check for /data mountpoint
action: assert exists /data
name: user oracle exists
action: assert command getent passwd oracle
The playbook continues if the assertion is true, and stops if the assertion is false.
Anyway, I’m sure there are plenty of ways to achieve this kind of thing, some of which may already exist. And if it doesn’t yet exist, let me know what a good syntax would look like and I’lll see what I can come up with…
Will