# Block of include\_tasks with handler/notify

**URL:** <https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389>\
**Category:** Ansible Project\
**Created:** [June 22, 2021, 4:57am UTC](https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389 "2021-06-22T04:57:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Engel](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@Stefan\_Engel](https://forum.ansible.com/u/Stefan_Engel)\
**Post date:** [June 22, 2021, 4:57am UTC](https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389/1 "2021-06-22T04:57:03Z")

</div>

Hi,

Im trying to achieve the following:

- creating a block with multiple include tasks
- If any of the tasks change, write the config and sync to HA device (F5)

tasks:

- name: F5 Vanity VIP update in all DC’s  
block:
- name: Update SSL profile  
include\_tasks: tasks/vanity/f5\_ssl\_profile\_update.yml
- name: Update irule  
include\_tasks: tasks/vanity/f5\_irule\_update.yml  
notify:
- Save sys config
- Sync configuration from device to group  
handlers:
- name: Save sys config
- name: Sync configuration from device to group

I’m getting the following error:  
**ERROR! ‘notify’ is not a valid attribute for a Block**

In the Ansible doc, I couldnt find a clear statement that notify isnt supported within a Block.

Appreciate your feedback.

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [June 22, 2021, 6:09am UTC](https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389/2 "2021-06-22T06:09:47Z")

</div>

See "Playbook Keywords". In 2.9, only task can notify a handler  
[https://docs.ansible.com/ansible/2.9/reference\_appendices/playbooks\_keywords.html](https://docs.ansible.com/ansible/2.9/reference_appendices/playbooks_keywords.html)

"latest" shows both task and block can notify a handler  
[https://docs.ansible.com/ansible/latest/reference\_appendices/playbooks\_keywords.html](https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html)

Works for me in 2.10

- hosts: localhost  
&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;&nbsp;- block:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- command: 'true'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changed\_when: true  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;notify: test  
&nbsp;&nbsp;handlers:  
&nbsp;&nbsp;&nbsp;&nbsp;- name: test  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: Handler test running.

gives

ok: [localhost] =\>  
&nbsp;&nbsp;msg: Handler test running.

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [June 22, 2021, 6:12am UTC](https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389/3 "2021-06-22T06:12:16Z")

</div>

/scratch/ansible-release-notes/CHANGELOG-v2.11.rst:- notify keyword  
is not ignored anymore on import\_tasks, also able to apply to blocks  
now.

---

<div class="post-metadata">

**Author:** ![Stefan\_Engel](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@Stefan\_Engel](https://forum.ansible.com/u/Stefan_Engel)\
**Post date:** [June 22, 2021, 8:00am UTC](https://forum.ansible.com/t/block-of-include-tasks-with-handler-notify/35389/4 "2021-06-22T08:00:14Z")

</div>

Thanks Vladimir! I’ll upgrade to 2.11.x core and give it another try
