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.
---
- name: Do stuff to stuff
hosts: localhost
tasks:
- name: set fact
set_fact:
thing: otherstuff
- name: myrole
include_role:
name: myrole
vars:
thing: "asdf"
- name: myrole
with_items:
- "aone"
- "atwo"
include_role:
name: myrole
vars:
thing: "{{ item }}"
EXPECTED RESULTS
Success
ACTUAL RESULTS
Error part of the output
TASK [myrole] ******************************************************************
task path: /mnt/c/Users/trond/Documents/projects/ansibledev/rolestesting/main.yml:13
failed: [localhost] (item=aone) => {
"failed": true,
"item": "aone",
"msg": "No role was specified to include"
}
failed: [localhost] (item=atwo) => {
"failed": true,
"item": "atwo",
"msg": "No role was specified to include"
}
ERROR! Unexpected Exception: 'results'
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