-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Variable in handlers of nested included role is undefined if left set to default #80459
Closed
1 task done
Labels
affects_2.14
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
verified
This issue has been verified/reproduced by maintainer
Comments
Files identified in the description: If these files are incorrect, please update the |
ansibot
added
affects_2.14
bug
This issue/PR relates to a bug.
needs_triage
Needs a first human triage before being processed.
labels
Apr 10, 2023
s-hertel
added
needs_verified
This issue needs to be verified/reproduced by maintainer
and removed
needs_triage
Needs a first human triage before being processed.
labels
Apr 11, 2023
mkrizek
added a commit
to mkrizek/ansible
that referenced
this issue
Aug 16, 2023
mkrizek
added
verified
This issue has been verified/reproduced by maintainer
and removed
needs_verified
This issue needs to be verified/reproduced by maintainer
labels
Aug 16, 2023
s-hertel
pushed a commit
that referenced
this issue
Aug 17, 2023
* include_role: expose vars from parent roles to role's handlers Fixes #80459
Thank you so much guys! 😄 I almost lost hope haha but I'm glad you finally fixed it |
mkrizek
added a commit
to mkrizek/ansible
that referenced
this issue
Aug 21, 2023
…le#81524) * include_role: expose vars from parent roles to role's handlers Fixes ansible#80459 (cherry picked from commit 98f1627)
mkrizek
added a commit
to mkrizek/ansible
that referenced
this issue
Aug 31, 2023
…le#81524) Fixes ansible#80459 (cherry picked from commit 98f1627)
sivel
pushed a commit
that referenced
this issue
Aug 31, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.14
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
verified
This issue has been verified/reproduced by maintainer
Summary
When I try to reference a variable in a handler of an included role B included whitin another role A and the role A is called from my playbook without specifying a value for the variable (hence leaving it set to the default value) Ansible gives me an error saying that the variable is undefined, while it should be set to the default value from role A. This is really difficult to explain, but easy to understand from the example below.
Issue Type
Bug Report
Component Name
default variable values handling
Ansible Version
Configuration
OS / Environment
Steps to Reproduce
File
playbook.yml
:File
role01/defaults/main.yml
:File
role01/tasks/main.yml
:File
role02/defaults/main.yml
:File
role02/handlers/main.yml
:File
role02/tasks/main.yml
:Then run
ansible-playbook playbook.yml
to see the result.Expected Results
I expect the value of the variable to be
value-for-myvar01-from-defaults
instead of undefined, like this:Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: