Something like include_vars but for playbooks

Hello to all,

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

E.g in a task file

`

- 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