1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix playbook includes so tags are obeyed (v2)

This commit is contained in:
James Cammarata 2015-05-11 12:48:03 -05:00
parent daf533c80e
commit 7b1c6fbab9
3 changed files with 11 additions and 2 deletions

View file

@ -61,10 +61,11 @@ class PlaybookInclude(Base, Taggable):
pb._load_playbook_data(file_name=file_name, variable_manager=variable_manager)
# finally, playbook includes can specify a list of variables, which are simply
# used to update the vars of each play in the playbook
# finally, update each loaded playbook entry with any variables specified
# on the included playbook and/or any tags which may have been set
for entry in pb._entries:
entry.vars.update(new_obj.vars)
entry.tags = list(set(entry.tags).union(new_obj.tags))
return pb

View file

@ -0,0 +1,6 @@
- hosts: localhost
gather_facts: no
tags:
- included
tasks:
- debug: msg="incuded playbook, variable is {{a}}"

View file

@ -0,0 +1,2 @@
- include: included_playbook.yml a=1
tags: include