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

Ensure we don't overwrite roles from include/import_role when loading the play #47512

Merged
merged 2 commits into from Oct 23, 2018

Conversation

sivel
Copy link
Member

@sivel sivel commented Oct 23, 2018

SUMMARY

Ensure we don't overwrite roles from include/import_role when loading the play. Fixes #47454

If a role listed under roles calls import_role or include_role+public=yes, the role from the import/include will be added to play.roles, but later when Play._load_roles completes, it will overwrite and remove the registered includes.

This brings in logic added to _load_roles that was introduced to fix a similar bug with handlers in 6acdc363174

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/playbook/play.py

ANSIBLE VERSION
2.7
2.8
ADDITIONAL INFORMATION

@sivel sivel changed the title Ensure we don't overwrite roles from the play when loading include/import_role Ensure we don't overwrite roles from include/import_role when loading the play Oct 23, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 23, 2018

Hi @sivel, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 23, 2018
@webknjaz webknjaz removed the needs_triage Needs a first human triage before being processed. label Oct 23, 2018
@sivel sivel merged commit d5e4f37 into ansible:devel Oct 23, 2018
sivel added a commit to sivel/ansible that referenced this pull request Oct 23, 2018
… when loading the play (ansible#47512)

* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes ansible#47454

* Add changelog fragment
(cherry picked from commit d5e4f37)

Co-authored-by: Matt Martz <matt@sivel.net>
abadger pushed a commit that referenced this pull request Oct 23, 2018
… when loading the play (#47512)

* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes #47454

* Add changelog fragment
(cherry picked from commit d5e4f37)

Co-authored-by: Matt Martz <matt@sivel.net>
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
… the play (ansible#47512)

* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes ansible#47454

* Add changelog fragment
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import_role does not expose default vars -- used inside another role
4 participants