Last Updated: February 25, 2016
·
915
· dstoflet

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

1 Response
Add your 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 ·