Ensure particular vars are set or bail
Make this the 1st task...
tasks:
- name: Validating setup
action: fail
msg="owner, group and webroot must be set!"
with_items: [ $owner, $group, $webroot ]
when_unset: $item
Written by Darryl Stoflet
Related protips
1 Response

This is great. What I would really like is "bail if not all of the variables used by this template are set", without having to explicitly enumerate the variables.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ansible
Authors

tartansandal
73.35K
Related Tags
#ansible
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#