Fix playbook includes so tags are obeyed (v2)
parent
daf533c80e
commit
7b1c6fbab9
|
@ -61,10 +61,11 @@ class PlaybookInclude(Base, Taggable):
|
||||||
|
|
||||||
pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
|
pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
|
||||||
|
|
||||||
# finally, playbook includes can specify a list of variables, which are simply
|
# finally, update each loaded playbook entry with any variables specified
|
||||||
# used to update the vars of each play in the playbook
|
# on the included playbook and/or any tags which may have been set
|
||||||
for entry in pb._entries:
|
for entry in pb._entries:
|
||||||
entry.vars.update(new_obj.vars)
|
entry.vars.update(new_obj.vars)
|
||||||
|
entry.tags = list(set(entry.tags).union(new_obj.tags))
|
||||||
|
|
||||||
return pb
|
return pb
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
- hosts: localhost
|
||||||
|
gather_facts: no
|
||||||
|
tags:
|
||||||
|
- included
|
||||||
|
tasks:
|
||||||
|
- debug: msg="incuded playbook, variable is {{a}}"
|
|
@ -0,0 +1,2 @@
|
||||||
|
- include: included_playbook.yml a=1
|
||||||
|
tags: include
|
Loading…
Reference in New Issue