mirror of https://github.com/ansible/ansible.git
IncludedFile: store _from args for proper deduplication (#85628)
* IncludedFile: store _from args for proper deduplication Fixes #66497 Co-authored-by: Matt Martz <matt@sivel.net>pull/85633/head
parent
9ed7164ed6
commit
4c04b8c7c3
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- include_role - allow host specific values in all ``*_from`` arguments (https://github.com/ansible/ansible/issues/66497)
|
||||
@ -0,0 +1,18 @@
|
||||
- hosts: testhost,localhost
|
||||
tasks:
|
||||
- include_role:
|
||||
name: role_from_args
|
||||
vars_from: "{{ inventory_hostname }}.yml"
|
||||
tasks_from: "{{ inventory_hostname }}.yml"
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- f1 is defined
|
||||
- f1 == inventory_hostname
|
||||
when: inventory_hostname == "testhost"
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- f2 is defined
|
||||
- f2 == inventory_hostname
|
||||
when: inventory_hostname == "localhost"
|
||||
@ -0,0 +1,2 @@
|
||||
- set_fact:
|
||||
f2: "{{ v }}"
|
||||
@ -0,0 +1,2 @@
|
||||
- set_fact:
|
||||
f1: "{{ v }}"
|
||||
@ -0,0 +1 @@
|
||||
v: localhost
|
||||
@ -0,0 +1 @@
|
||||
v: testhost
|
||||
Loading…
Reference in New Issue