- hosts: localhost
  gather_facts: false
  tasks:
    - fail: msg="lola is not set"
      when: lookup('env', 'lola') == ''

This fails the play
#>ansible-playbook play.yml

PLAY ***************************************************************************

TASK [fail msg=lola is not set] ************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true,
"msg": "lola is not set"}

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1



And this continues play
#>lola=is ansible-playbook play.yml

PLAY ***************************************************************************

TASK [fail msg=lola is not set] ************************************************
skipping: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=0


note that the fail is 'per host'
-- 
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mU5BT4OGYed5678cmuSx%3DN4r%3DmHvubSQPqS-p505sD7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to