Hi,
I'm experiencing a strange phenomenon with the block statement. If I 
rearrange a when statement I get syntax error. But the data-structure of 
both playbooks is the same:

Play that works:

---
- hosts: localhost
  connection: local
  tasks:
  - block:
      - debug: msg="The Message"
    when: true


Same play only lines resorted throws error:
The "with" line arranged directly under the "block" line. Since it's a 
dictionary there should be no difference?

---
- hosts: localhost
  connection: local
  tasks:
  - block:
    when: true
      - debug: msg="The Message"


============================= output ======================
uhochholdinger@xelo:~$ ansible-playbook -i localhost, block_test.yml 
ERROR! Syntax Error while loading YAML.


The error appears to have been in '/home/uhochholdinger/block_test.yml': 
line 7, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    when: true
      - debug: msg="The Message"
             ^ here
===========================================================


Bug or feature?

Cheers
      Ulli

PS:
uhochholdinger@xelo:~$ ansible --version
ansible 2.0.0.2

-- 
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/da1e20b4-4a0f-40e0-b0c1-b81790d57cee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to