# workaround to using a variable list of vars with include

**URL:** <https://forum.ansible.com/t/workaround-to-using-a-variable-list-of-vars-with-include/19336>\
**Category:** Ansible Project\
**Created:** [September 23, 2015, 11:27am UTC](https://forum.ansible.com/t/workaround-to-using-a-variable-list-of-vars-with-include/19336 "2015-09-23T11:27:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javeria\_Khan](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Javeria\_Khan](https://forum.ansible.com/u/Javeria_Khan)\
**Post date:** [September 23, 2015, 11:27am UTC](https://forum.ansible.com/t/workaround-to-using-a-variable-list-of-vars-with-include/19336/1 "2015-09-23T11:27:19Z")

</div>

Hi everyone,

I need to include a playbook which is essentially contains a set of inititalization tasks for any set of variables passed to it. Like so:

1. 
  - include: upstart\_common\_init.yml

2. vars:

3. program\_name: “{{ item.service\_name }}”

4. program\_config\_options: “–config-file /etc/xyz/{{ item.service\_conf }}”

5. system\_user: “{{ system\_user\_name }}”

6. system\_group: “{{ system\_group\_name }}”

7. service\_home: “{{ system\_home\_folder }}”

8. with\_items: some\_services

9. when: \>

10. inventory\_hostname in groups[item.service\_group] and

11. item.service\_en == true

12. tags:

13. 
  - upstart-init

Where the some\_services is a dictionary of services:

some\_services:

- { service\_name: abc, service\_en: True, service\_conf: abc.ini, service\_group: abc\_group }

- { service\_name: def, service\_en: True, service\_conf: def.ini, service\_group: def\_group }

I know **with\_items** isn’t supported with **include** so i get:

1. ERROR: [DEPRECATED]: include + with\_items is a removed deprecated feature, Please update your playbooks.

What would be a reasonable way to implement the above block of code?

Thanks,  
J
