# Something like include\_vars but for playbooks

**URL:** <https://forum.ansible.com/t/something-like-include-vars-but-for-playbooks/19495>\
**Category:** Ansible Project\
**Created:** [October 13, 2015, 2:19pm UTC](https://forum.ansible.com/t/something-like-include-vars-but-for-playbooks/19495 "2015-10-13T14:19:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Lagos](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@Diego\_Lagos](https://forum.ansible.com/u/Diego_Lagos)\
**Post date:** [October 13, 2015, 2:19pm UTC](https://forum.ansible.com/t/something-like-include-vars-but-for-playbooks/19495/1 "2015-10-13T14:19:59Z")

</div>

Hello to all,

I need to choose between two variables file depending on an external parameter.

E.g in a task file

`

```auto
- include_vars: jboss_5.yml
  when: "{{ my_app_version | version_compare('8', '=') }}"

- include_vars: jboss_7.yml
  when: "{{ my_app_version | version_compare('10', '=') }}"

```

`

This files vars contains the java version, the paths, and others info, useful for the installation.  
Because my app use different version of jboss.

Inside tasks I can safely use include\_vars and version compare, as showed.

But I want that this mechanism could be used in a playbook, so that all my play can use variables valorised correctly  
right now i must use this workaround that i don’t like it
