Hi all.
I often write plays that require extra vars. eg “ansible-playbook user -e user=bob”
In that play, I’ll start off with
- fail: msg=“You forgot to set the user variable”
when: user is not defined or user == “”
And I was thinking it might be nice to write an external, reusable play that would be called like this:
- include: check_defined.yaml checkvar=user
and look something like this