0

I have a playbook like:

- hosts: GROUP1
  remote_user: ubuntu
  become: true
  gather_facts: False
  roles:
  - role: role1
  - role: role2

The in group_var
GROUP1 has php7 packages
GROUP2 has php5 packages

when I run the runbook both php5 and php7 variables are getting pulled in
ansible-playbook -vvv is showing both lists of packages, but I can't figure out
how the php5 variables are getting pulled in since the GROUP1 file only has php7 packages listed

There are no host_var files. Don't even have a host_var folder

Other than -vvv is there a way to see where variables are coming from or which variable files are getting included?

Francisco1844
  • 260
  • 2
  • 8
  • 3
    You haven't really given us enough context to give you the answer. I do think you should look at the output of `ansible-inventory --list` and verify that hosts are in the groups, and only the groups you think they should be. – Zoredache Aug 30 '20 at 07:11
  • And check your group and host vars if those packages aren't defined somewhere else. – Gerald Schneider Aug 30 '20 at 14:04

1 Answers1

0

After some trial an error found the issue. My groups were actually like this
php5
php <-- was using this for php7 packages

The processing for php was pulling both the php and php5 groups.Upgraded ansible and that seem to have changed the behavior, but was still not what I expected.

In the end I just made the groups not a subset of each other like
php5
php7

And that solved the issue.

Francisco1844
  • 260
  • 2
  • 8