Hello,
While trying to move over to Ansible 2.1 from 1.9.2, I've noticed Ansible
having a lot of output about skipping vars_file when I pass "-vvv" to
ansible-playbook. I'm including 3 vars_file(s) using variable
substitution. I've looked in the projects reported bugs and checked the
mailing list with no one describing or reporting this behavior. Below is
an example of what I'm doing:
---
- hosts: all
user: root
vars_files:
- var_files/{{ ansible-distribution }}.yml
- var_files/{{ ansible_distribution }}-{{
ansible_distribution_major_version }}.yml
- var_files/{{ ansible_distribution }}-{{ ansible_distribution_version
}}.yml
roles:
- blah
I'm getting the skipping vars_file message about 150+ times before the
PLAYBOOK output line, with additional messages after the PLAYBOOK line,
PLAY [all] line, Task SETUP line, and after my last task plays. The odd
thing is that when I test the variables and their precedence that are in
the appropriate files, I'm getting the correct variables. So it seems that
it is actually reading the var_files appropriately regardless of the
messages and no confirmation messages that they were actually included/read
at some point. Should I report this as a bug to the Ansible project or is
this method no longer the "supported" way to include dynamic vars_file(s)?
I've come up with a workaround to avoid these messages which is below.
Guidance on the situation and whether this is actually a bug or not is
appreciated.
---
- hosts: all
user: root
pre_tasks:
- include_vars: 'var_files/{{ ansible-distribution }}.yml'
tags: always
- include_vars: 'var_files/{{ ansible_distribution }}-{{
ansible_distribution_major_version }}.yml'
tags: always
- include_vars: 'var_files/{{ ansible_distribution }}-{{
ansible_distribution_version }}.yml'
tags: always
roles:
- blah
Thanks,
Chris
--
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/94efb0c1-4c6a-4091-9dfb-3077b1eddfca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.