# Error in block declaration

**URL:** <https://forum.ansible.com/t/error-in-block-declaration/35344>\
**Category:** Ansible Project\
**Created:** [June 14, 2021, 1:32pm UTC](https://forum.ansible.com/t/error-in-block-declaration/35344 "2021-06-14T13:32:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [June 14, 2021, 1:32pm UTC](https://forum.ansible.com/t/error-in-block-declaration/35344/1 "2021-06-14T13:32:13Z")

</div>

I have a playbook that is being included in a role I’m creating:

- name: Set up permissions  
include\_tasks: sitepermissions.yml  
loop: “{{ folders }}”

In sitepermissions.yml, I’m trying to define a block:

- name: Create Temp Area  
block:

- name: Create {{ folders.site }} Temp Directory  
file:  
path: “/path/to/temp”  
state: directory  
mode: 0750  
owner: root  
group: “{{ folders.group }}”

- name: Set sticky bit on {{ folders.site }} Temp Directory  
file:  
path: “/path/to/temp”  
state: directory  
mode: g+s

- name: Set ACL on {{ folders.site }} EFSTS Directory  
acl:  
path: “/path/to/temp”  
entity: “{{ sitegroup }}”  
etype: group  
permissions: rx  
default: yes  
state: present

when: “{{ folders.createtemp }}” | bool

When the playbook runs, I get the error:  
(): did not find expected comment or line break while scanning a block scalar at line 1220 column 32

Any ideas on what could be wrong with my block statement?

Thanks,  
Harry

---

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [June 14, 2021, 6:35pm UTC](https://forum.ansible.com/t/error-in-block-declaration/35344/2 "2021-06-14T18:35:43Z")

</div>

I believe I figured out my issues. Since I was including the 2nd playbook, references to the main variables had to be {{ item.group }} instead of {{ folders.group }}, etc. Also, in the “when” clause, I found that I needed to remove the curly braces and have the entire check in quotes. Then everything worked.

Thanks,  
Harry
