# Passing One Item Through Entire Playbook Instead of All Items

**URL:** <https://forum.ansible.com/t/passing-one-item-through-entire-playbook-instead-of-all-items/29082>\
**Category:** Ansible Project\
**Created:** [November 20, 2018, 6:27pm UTC](https://forum.ansible.com/t/passing-one-item-through-entire-playbook-instead-of-all-items/29082 "2018-11-20T18:27:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acharyatejaswi25](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@acharyatejaswi25](https://forum.ansible.com/u/acharyatejaswi25)\
**Post date:** [November 20, 2018, 6:27pm UTC](https://forum.ansible.com/t/passing-one-item-through-entire-playbook-instead-of-all-items/29082/1 "2018-11-20T18:27:20Z")

</div>

Hi,

I want to pass only one item from a list of variables throughout the entire playbook.

For Example, I have six action tasks within the playbook and from the first action task output data using jinja2 template defined a variable using “set\_fact” and appended the required values into a list.Now using “with\_items” I could able to pass all the values into other five action tasks. And each action task is getting executed with items defined for that play.

But instead of passing all the values once, can I have a possibility like first item should pass through the five action tasks and second item should pass through the same five action tasks again and so on.Even I have checked with “loop\_control” for passing each item through the five action tasks.

Can we have an item to be passed through the entire playbook instead of using with\_items where for each play we define this with\_items to be passed as an item and get the output of all the items.

Thanks,  
Acharya Tejaswi Indurthy.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 23, 2018, 6:03am UTC](https://forum.ansible.com/t/passing-one-item-through-entire-playbook-instead-of-all-items/29082/2 "2018-11-23T06:03:44Z")

</div>

Its hard to understand without seeing your playbook tasks but it sounds like you want to loop through a set of tasks, which you can do by looping over include\_role or import\_role However it is well worth reading through this thread [https://github.com/ansible/ansible/issues/13262](https://github.com/ansible/ansible/issues/13262)

Depending on what you are trying to achieve there might be another way to go about it which doesn’t involve complex looping and making a playbook that might be hard for others to understand.

You might, for example, be able to use handlers to trigger certain tasks only when another has reported that it is changed.

Or if you have some very specific requirements maybe some parts might be best written as a script or a custom module.

Hope this helps but its hard to make useful suggestions without seeing the detail of what you are trying to achieve.

Jon
