Hello,
I face a strange behaviour on Ansible 2.2.2, which I didn't have on 1.9.
Inventory group vars seems to be defined after all the vars in my playbook
My inventory:
inventory/
production/
production
group_vars/
all.yml
My playbook:
- hosts: all
vars_files:
- vars/{{stage}}/frontend/main.yml
- vars/{{stage}}/frontend/{{front_name}}.yml
- vars/{{stage}}/frontend/{{group_names[0]}}.yml
stage is defined in inventory/production/group_vars/all.yml
When I run my playbook, it fails loading my var_files because stage does
not exist.
if I replace my playbook with the following, it works:
- hosts: all
vars_files:
- "{{ inventory_dir }}/group_vars/all.yml"
- vars/{{stage}}/frontend/main.yml
- vars/{{stage}}/frontend/{{front_name}}.yml
- vars/{{stage}}/frontend/{{group_names[0]}}.yml
Best regards,
Fred
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9de155db-43d6-4708-b7f3-24a502fea917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.