# Inventory group not getting created when using add\_host and one of the iteration of task fails.

**URL:** <https://forum.ansible.com/t/inventory-group-not-getting-created-when-using-add-host-and-one-of-the-iteration-of-task-fails/37694>\
**Category:** Ansible Developer\
**Created:** [February 23, 2023, 7:50pm UTC](https://forum.ansible.com/t/inventory-group-not-getting-created-when-using-add-host-and-one-of-the-iteration-of-task-fails/37694 "2023-02-23T19:50:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bunty\_G](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@Bunty\_G](https://forum.ansible.com/u/Bunty_G)\
**Post date:** [February 23, 2023, 7:50pm UTC](https://forum.ansible.com/t/inventory-group-not-getting-created-when-using-add-host-and-one-of-the-iteration-of-task-fails/37694/1 "2023-02-23T19:50:29Z")

</div>

Inventory group not getting created when using add\_host and one of the iteration of task fails.

Below is the playbook

---

<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:** [March 6, 2023, 6:09pm UTC](https://forum.ansible.com/t/inventory-group-not-getting-created-when-using-add-host-and-one-of-the-iteration-of-task-fails/37694/2 "2023-03-06T18:09:11Z")

</div>

it is not really effective until the 'next play' as modifying the  
current play's data is very problematic.
