Is it possible to include a vars file in Ansible into another vars file dynamically?
I.e. I have vars file:
---
definitions:
- { product: web_v2, suite:
Unfortunately, vars files do not have include statements.
You can either put all the vars into the definitions
dictionary, or add the variables as another dictionary in the same file.
If you don't want to have them in the same file, you can include them at the playbook level by adding the vars file at the start of the play:
---
- hosts: myhosts
vars_files:
- default_step.yml
or in a task:
---
- hosts: myhosts
tasks:
- name: include default step variables
include_vars: default_step.yml