mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
Moving ConnectionInformation -> PlayContext
Also making PlayContext a child class of the Playbook Base class, which gives it access to all of the FieldAttribute code to ensure field values are correctly typed after post_validation Fixes #11381
This commit is contained in:
parent
919aaa5c42
commit
e64989beb4
36 changed files with 477 additions and 459 deletions
|
@ -9,8 +9,8 @@ import multiprocessing
|
|||
from ansible.inventory import Inventory
|
||||
from ansible.inventory.host import Host
|
||||
from ansible.playbook.play import Play
|
||||
from ansible.playbook.play_context import PlayContext
|
||||
from ansible.playbook.task import Task
|
||||
from ansible.executor.connection_info import ConnectionInformation
|
||||
from ansible.executor.task_executor import TaskExecutor
|
||||
from ansible.executor.task_result import TaskResult
|
||||
from ansible.parsing import DataLoader
|
||||
|
@ -144,8 +144,8 @@ inventory = Inventory(host_list='/tmp/med_inventory', loader=loader, variable_ma
|
|||
hosts = inventory.get_hosts()[:]
|
||||
debug("done loading inventory")
|
||||
|
||||
ci = ConnectionInformation()
|
||||
ci.connection = 'local'
|
||||
play_context = PlayContext()
|
||||
play_context.connection = 'local'
|
||||
|
||||
for i in range(NUM_TASKS):
|
||||
#for j in range(NUM_HOSTS):
|
||||
|
@ -158,7 +158,7 @@ for i in range(NUM_TASKS):
|
|||
task_vars = dict()
|
||||
new_t = t.copy()
|
||||
new_t.post_validate(task_vars)
|
||||
send_data((h, t, task_vars, ci))
|
||||
send_data((h, t, task_vars, play_context))
|
||||
debug("done queuing %s %d" % (h, i))
|
||||
_process_pending_results()
|
||||
debug("waiting for the results to drain...")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue