# Meta module

**URL:** <https://forum.ansible.com/t/meta-module/36802>\
**Category:** Ansible Project\
**Created:** [July 4, 2022, 7:57pm UTC](https://forum.ansible.com/t/meta-module/36802 "2022-07-04T19:57:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brice\_Folio](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@brice\_Folio](https://forum.ansible.com/u/brice_Folio)\
**Post date:** [July 4, 2022, 7:57pm UTC](https://forum.ansible.com/t/meta-module/36802/1 "2022-07-04T19:57:20Z")

</div>

Hello,

I have playbook played in tower and at the end of a block I use meta: end\_play module without any condition.  
I don’t know why but this task is ignored and when I enable debug it displays:  
META:  
Instead of:  
META: END PLAY

What can be the reason for tower or ansible to ignore meta?

Best Regards,  
Folio Brice Roland

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 5, 2022, 1:33pm UTC](https://forum.ansible.com/t/meta-module/36802/2 "2022-07-05T13:33:05Z")

</div>

-vvv output of that task would be helpful in finding out

---

<div class="post-metadata">

**Author:** ![brice\_Folio](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@brice\_Folio](https://forum.ansible.com/u/brice_Folio)\
**Post date:** [July 5, 2022, 1:48pm UTC](https://forum.ansible.com/t/meta-module/36802/3 "2022-07-05T13:48:28Z")

</div>

Hi,

I tried it, without success.  
No information in output, except for the task just before it.

Best Regards,  
Folio Brice Roland

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [July 5, 2022, 3:17pm UTC](https://forum.ansible.com/t/meta-module/36802/4 "2022-07-05T15:17:32Z")

</div>

That is all capitals, and it's not an item in a list.  
Can you post the actual YAML instead of some mangled human interpretation?

Dick

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 5, 2022, 6:00pm UTC](https://forum.ansible.com/t/meta-module/36802/5 "2022-07-05T18:00:16Z")

</div>

so it is working, the play is ending, it is not being skipped

---

<div class="post-metadata">

**Author:** ![brice\_Folio](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@brice\_Folio](https://forum.ansible.com/u/brice_Folio)\
**Post date:** [July 6, 2022, 9:43am UTC](https://forum.ansible.com/t/meta-module/36802/6 "2022-07-06T09:43:08Z")

</div>

Hi,

Here the issuing part of code:

- name: “Check aggregated interface configuration and save the differences”  
ansible.builtin.set\_fact:  
aggregated\_interface\_configuration\_difference: “{{ lines | difference(r\_aggregated\_interface\_configuration.stdout\_lines | first) }}”  
vars:  
lines:

- inherit port-profile RLB-CLIENT-TRUNK-PO-MEMBER-10G

- " description PZB-{{ server\_serial\_number }}-{{ pizza\_box\_name }}"

- " channel-group {{ port\_channel\_id }}"

- " no snmp trap link-status"

- name: “Check difference between the configuration of interfaces and targets configurations”  
ansible.builtin.assert:  
that:

- (po\_configuration\_difference | length) == 0

- (aggregated\_interface\_configuration\_difference | length) == 0  
fail\_msg: “Port-channel for {{ server\_serial\_number }}-{{ pizza\_box\_name }} duo already exists with wrong configuration, cannot create new configuration”

- name: “Close session if port-channel and interfaces configurations are correct”  
ansible.builtin.meta: end\_play

- name: “Validate discovered interfaces”  
run\_once: yes  
delegate\_to: localhost  
any\_errors\_fatal: yes  
vars:  
all\_switches\_interfaces: “{{ hostvars | dict2items(key\_name=‘host’, value\_name=‘hostvars’) | selectattr(‘hostvars.interface\_without\_po\_set’, ‘defined’) | map(attribute=‘hostvars.interface\_without\_po\_set’) | list | flatten }}”

…

Here, the result:  
TASK [Check aggregated interface configuration and save the differences] \*\*\*\*\*\*\*  
skipping: [SWITCH56]  
skipping: [SWITCH55]  
skipping: [SWITCH58]  
skipping: [SWITCH57]  
skipping: [SWITCH65]  
skipping: [SWITCH66]  
ok: [SWITCH64]  
ok: [SWITCH63]

TASK [Check difference between the configuration of interfaces and targets configurations] \*\*\*  
skipping: [SWITCH56]  
skipping: [SWITCH55]  
skipping: [SWITCH57]  
skipping: [SWITCH58]  
skipping: [SWITCH66]  
skipping: [SWITCH65]  
ok: [SWITCH64] =\> {  
“changed”: false,  
“msg”: “All assertions passed”  
}  
ok: [SWITCH63] =\> {  
“changed”: false,  
“msg”: “All assertions passed”  
}

TASK [Validate discovered switch interfaces from switch-side MAC addresses] \*\*\*\*  
ok: [SWITCH56 → localhost]

As you can see, the task **Check difference between the configuration of interfaces and targets configuratio** ns is successfull so just after that the meta end play must stop the execution but the playbook continues and the next task **Validate discovered switch interfaces from switch-side MAC addresses** is played.

So I don’t understand.

Best Regards,  
Folio Brice Roland

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 6, 2022, 12:27pm UTC](https://forum.ansible.com/t/meta-module/36802/7 "2022-07-06T12:27:35Z")

</div>

You don't have any conditionals defined on the tasks, but from the  
output you show they are inheriting some conditional (otherwise they  
would not skip hosts) so the meta task is probably skipped because the  
first host that triggers it has that conditional result in False (see  
run\_once/bypass host loop behaviors).

---

<div class="post-metadata">

**Author:** ![brice\_Folio](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@brice\_Folio](https://forum.ansible.com/u/brice_Folio)\
**Post date:** [July 6, 2022, 2:48pm UTC](https://forum.ansible.com/t/meta-module/36802/8 "2022-07-06T14:48:23Z")

</div>

Hi Brian !

Thanks a lot!  
Indeed,as the first host that triggered it does not have the required conditions the task is skipped for all others hosts.  
It seems that it does not work like others modules that check the condition for all hosts to execute or not the task for each of them.

Best Regards,  
Folio Brice Roland

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 7, 2022, 2:30pm UTC](https://forum.ansible.com/t/meta-module/36802/9 "2022-07-07T14:30:34Z")

</div>

many actions do this, they normally have a note that states they  
'bypass host loop', for example add\_host, and group\_by do the same  
thing.
