-
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
include_role does not work with with_items #17966
Comments
@trondhindenes: Thanks for taking the time to open this issue, but it was filed under the wrong github repository. Please create a new issue at https://github.com/ansible/ansible-modules-core/issues |
@bcoca was this closed in error? |
@detiber I opened it in modules-core instead. |
@trondhindenes indeed, I posted that prior to realizing that include_role is actually implemented in ansible-modules-core. Apologies for the noise. |
actually its not a module but coded inside the core interpreter, sadly the bot does not realize this and takes the documentation stub in core as a sign that it is a module. bot_skip the repo unification will make all this go away. |
closed the issue I opened in modules-core, tracking here instead |
@bcoca thanks! Looping now works, but it doesn't look like the role inside the loop is able to access the "item" dynamic var in a with_items loop. Do you want me to post some example code here, or open a new issue? |
already pushed 2nd part of fix that takes care of that |
sweet, thanks! |
@detiber thanks for the heads up |
Is loop variable interpolation supported in the role name? I'm seeing the following on the latest version from - include_role:
name: "{{ item }}"
with_items:
- "x"
- "y"
|
fixes ansible#17966 (cherry picked from commit 01b75f9)
fixes ansible#17966 (cherry picked from commit 99220a5)
ISSUE TYPE
COMPONENT NAME
include_role
ANSIBLE VERSION
SUMMARY
The new "include_role" task does not work with with_items
STEPS TO REPRODUCE
In the example playbook below, the role "myrole" is first run stand-alone, and then as a with_items loop.
EXPECTED RESULTS
Success
ACTUAL RESULTS
Error part of the output
The text was updated successfully, but these errors were encountered: