Use the computed role name instead of 'role'. Fixes #38838 (#39516)

This commit is contained in:
Matt Martz 2018-04-30 14:41:13 -05:00 committed by GitHub
parent 5f9b7046ed
commit 240b060c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -1,5 +1,5 @@
- name: Test include_role
hosts: testhost
hosts: testhost,testhost2
vars:
run_role: yes
@ -85,10 +85,27 @@
include_role:
name: "{{ role_name }}"
- name: wipe role results
set_fact:
_role2_result: ~
_role3_result: ~
- name: Test using a host variable for role name
include_role:
name: "{{ host_var_role_name }}"
- name: assert that host varible for role name calls 2 diff roles
assert:
that:
- _role2_result is not none
when: inventory_hostname == 'testhost2'
- name: assert that host varible for role name calls 2 diff roles
assert:
that:
- _role3_result is not none
when: inventory_hostname == 'testhost'
- name: Pass variable to role
include_role:
name: role1