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"
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