mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Let the callbacks see the playbook and (current) runner objects.
This commit is contained in:
parent
b0a64973b6
commit
0d11f53eff
2 changed files with 5 additions and 0 deletions
|
@ -114,6 +114,9 @@ class PlayBook(object):
|
||||||
self.private_key_file = private_key_file
|
self.private_key_file = private_key_file
|
||||||
self.only_tags = only_tags
|
self.only_tags = only_tags
|
||||||
|
|
||||||
|
self.callbacks.playbook = self
|
||||||
|
self.runner_callbacks.playbook = self
|
||||||
|
|
||||||
if inventory is None:
|
if inventory is None:
|
||||||
self.inventory = ansible.inventory.Inventory(host_list)
|
self.inventory = ansible.inventory.Inventory(host_list)
|
||||||
self.inventory.subset(subset)
|
self.inventory.subset(subset)
|
||||||
|
|
|
@ -157,6 +157,8 @@ class Runner(object):
|
||||||
self.environment = environment
|
self.environment = environment
|
||||||
self.complex_args = complex_args
|
self.complex_args = complex_args
|
||||||
|
|
||||||
|
self.callbacks.runner = self
|
||||||
|
|
||||||
# misc housekeeping
|
# misc housekeeping
|
||||||
if subset and self.inventory._subset is None:
|
if subset and self.inventory._subset is None:
|
||||||
# don't override subset when passed from playbook
|
# don't override subset when passed from playbook
|
||||||
|
|
Loading…
Reference in a new issue