Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible selects wrong group_vars in combination with --limit and host in multiple groups #17559

Closed
cisarpavel opened this issue Sep 14, 2016 · 1 comment

Comments

@cisarpavel
Copy link

ISSUE TYPE

Bug Report

COMPONENT NAME

group vars selection

ANSIBLE VERSION
2.1.1.0
CONFIGURATION

default pip install

OS / ENVIRONMENT

Ubuntu 16.04

SUMMARY

If you have host defined in more groups, and you will run playbook with --limit arg for the one of them, ansible loads vars for all groups where the host is assigned and take varibles from the latest loaded group vars ignoring --limit arg.

STEPS TO REPRODUCE

host file

[agroup]
server

[zgroup]
server

group_vars structure folders/file structure

group_vars
    - agroup
        - vars
    - zgroup
        - vars

run

ansible-playbook some_palybook.yml --limit=agroup

ansible will took variables from zgroup instead of limited agroup

EXPECTED RESULTS

playbook will select correct group_vars for agroup

ACTUAL RESULTS

playbook selects group_vars for zgroup

@ansibot ansibot added bug_report affects_2.1 This issue/PR affects Ansible v2.1 labels Sep 14, 2016
@bcoca bcoca removed affects_2.1 This issue/PR affects Ansible v2.1 bug_report labels Sep 14, 2016
@bcoca
Copy link
Member

bcoca commented Sep 14, 2016

Possible Misunderstanding

Hi!

Thanks very much for your submission to Ansible. It sincerely means a lot to us.

We believe the ticket you have filed is being somewhat misunderstood, as one thing works a little differently than stated.

Ansible loads inventory independent from from play targets, --limit only affects play targets and is not designed to restrict inventory loading.

In the future, this might be a topic more well suited for the user list, which you can also post here if you'd like some more help with the above.

Thank you once again for this and your interest in Ansible!

@bcoca bcoca closed this as completed Sep 14, 2016
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants