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: Fix for missing group names in get_variables() #724

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

marcandre-larochelle-bell
Copy link
Contributor

The Ansible variable group names contains all groups the host is part of and not only the direct parent groups, this is a fix to reflect how ansible works.

Link to documentation:

@marcandre-larochelle-bell
Copy link
Contributor Author

Hi, sorry to tag you @philpep, this should be a quick fix, otherwise I need to monkey patch the fix in my code and I'd rather not.

Basically it didn't list all the groups the way ansible does it (by including all the groups it is part of, not just the direct parents). This allows to load the ansible variables the way they should be loaded (by loading the top parents, then overriding by loading the children of the top parent, then by the children of the children).

Thanks in advance.

@philpep philpep added bug This issue/PR relates to a bug. ansible labels Aug 24, 2023
@philpep
Copy link
Contributor

philpep commented Aug 24, 2023

Hi, LGTM, can you also fix the two related broken tests ? https://github.com/pytest-dev/pytest-testinfra/actions/runs/5765772823/job/16193366140?pr=724

Thanks!

@marcandre-larochelle-bell
Copy link
Contributor Author

@philpep Done!

@philpep philpep merged commit 01db77f into pytest-dev:main Aug 28, 2023
7 checks passed
@philpep
Copy link
Contributor

philpep commented Aug 28, 2023

Merged, thanks!

@marcandre-larochelle-bell
Copy link
Contributor Author

Hi, just wondering if you know when there'll be a release with the fix (maybe 9.0.1?), we're currently using a monkey patch as a workaround on our side, but we'd much prefer not to! Thanks in advance

asm0deuz added a commit to asm0deuz/ceph-ansible that referenced this pull request Jan 15, 2024
pytest-infra 10.0.0 release
(pytest-dev/pytest-testinfra#724)
changed the get_variables() behavior which led to CI failures

Signed-off-by: Teoman ONAY <tonay@ibm.com>
asm0deuz added a commit to asm0deuz/ceph-ansible that referenced this pull request Jan 15, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 13, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 13, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 13, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 13, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 13, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Feb 14, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Mar 9, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 37a8222)
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Mar 10, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 37a8222)
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Mar 10, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 37a8222)
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Mar 10, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 37a8222)
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Mar 11, 2024
pytest-infra 10.0.0 release changed the get_variables() behavior which led to CI failures
(pytest-dev/pytest-testinfra#724)
Starting of now all groups the host is part of and not only the direct parent groups are
returned by get_variables()

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 37a8222)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants