Task prerequisites

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

(A) it will be true at some point in 0.7 that we can reference the
return value of the last result as a variable like $last_result, which
would be usable in only_if. Until now, and even later, you can still
write
a custom fact to return the presense/absense of a path.

(B) if you haven't linked it, I don't understand how it could
possibly know that, so that doesn't make sense to me.