# question relative to include + with\_items deprecation in 1.5

**URL:** <https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642>\
**Category:** Ansible Developer\
**Created:** [October 9, 2013, 1:56pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642 "2013-10-09T13:56:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 1:56pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/1 "2013-10-09T13:56:48Z")

</div>

Hello,

I saw the deprecation warning appear today.

Will this also apply to " role + with\_items " ?

I have no “include + with\_items” but several “role + with\_item” and the deprecation warning also shows on my roles + with\_items

If the deprecation warning also stands for the roles, maybe it would be better to update the deprecation message.

What is the best practice as a replacement ? use with\_items only at the task level ?

Thank you for your help !

Jerome

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 9, 2013, 2:04pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/2 "2013-10-09T14:04:51Z")

</div>

role + with\_items was never documented either. It doesn’t exist. I’m ok with the error text unless you’re saying it doesn’t raise a warning when attached to a role?

Yes, you should loop inside the tasks.

I’m working on a nice way so it’s more obvious how to pass references to variables in without resorting to old style variable references, that will still make this easy to pass parameters to roles that might be lists.

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 2:09pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/3 "2013-10-09T14:09:37Z")

</div>

It does raise a warning when using { role + with\_items }. I didn’t know I was the only one using the role + with\_items !  
I will have to modify my scripts.

will you deprecate also the { role + sudo, sudo\_user } ?

Thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 9, 2013, 2:15pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/4 "2013-10-09T14:15:05Z")

</div>

“will you deprecate also the { role + sudo, sudo\_user } ?”

no plans for this at all, and I use this feature often.

It’s only an issue with how the “with\_items” thing was implemented.

This feature has been intentionally undocumented for many releases because it has been horribly broken and I would like to take steps to finally remove it and keep people from asking questions about it 🙂

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 2:23pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/5 "2013-10-09T14:23:15Z")

</div>

Well I knew it did not work with inventory variables and found it was handy to avoid stating roles N times in my playbook.

For instance, I am installing several version of nginx with :

- { sudo: yes, sudo\_user: “{{ item.user }}”, role: nginx, conf: $item, with\_items: nginx\_instances }

and I like it that the role:nginx is not obscured by with\_items all over the place.

but I am certainly wrong as to the extensibility of this scheme on complex inventories.

Imagine that for a good reason you want to install several version of nginx on the same box, how would you organize playbooks / roles ?

thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 9, 2013, 2:31pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/6 "2013-10-09T14:31:40Z")

</div>

There’s about 5000 posts on with\_items on the mailing list, so I am going to skip repeating it again.

The general problem is it doesn’t work with variables in lots of different scopes.

---

<div class="post-metadata">

**Author:** ![Jerome\_Wagner](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jerome\_Wagner](https://forum.ansible.com/u/Jerome_Wagner)\
**Post date:** [October 9, 2013, 2:41pm UTC](https://forum.ansible.com/t/question-relative-to-include-with-items-deprecation-in-1-5/13642/7 "2013-10-09T14:41:41Z")

</div>

ok thanks.

I did not want to re-open the debate I am trying to modify my playbooks the appropriate way to anticipate the deprecation.

going back to the playbooks ;

Jerome
