PM> Since ansible 2.2.0 when using a when condition for a block, inner
PM> when are no more evaluated and are executed.

Hmm, I can't reproduce this. In your example playbook, you say "blocks"
rather than "block", but that gives an immediate syntax error.

Here's how I tried to reproduce it. foo.yml:

  - hosts: localhost
    tasks:
      - block:
          - include: alpha.yml
            when: checkpoint_alpha is defined
          - include: bravo.yml
            when: checkpoint_bravo is defined
        when: checkpoints is defined

alpha.yml:

  - debug: msg="checkpoint alpha"

bravo.yml:

  - debug: msg="checkpoint bravo"

If I run foo.yml with:

  (no extra-vars)
  --extra-vars "checkpoint_alpha=1"
  --extra-vars "checkpoint_alpha=1 checkpoints=1"
  --extra-vars "checkpoint_alpha=1 checkpoint_bravo=1 checkpoints=1"

The first two don't print any debug messages; the third prints the alpha
debug message but not the bravo on; the fourth prints both debug messages.
Same behavior in 2.1.1.0-1 and 2.2.0.0-1.

                                      -Josh (j...@care.com)

(apologies for the automatic corporate disclaimer that follows)

This email is intended for the person(s) to whom it is addressed and may 
contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, 
distribution, copying, or disclosure by any person other than the addressee(s) 
is strictly prohibited. If you have received this email in error, please notify 
the sender immediately by return email and delete the message and any 
attachments from your system.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/22563.12193.877675.601846%40gargle.gargle.HOWL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to