Aim is to have a File (instead of the dict) containing Ansible tasks and and run them via Play() and TaskQueueManager() - as stated in the following example.
task-file:
tasks:
- copy: src=files/foo dest=/tmp/foo owner=root group=root mode=0644
- sysctl: name=net.ipv4.ip_forward value=1 state=present
- apt: name=wget state=absent
I'm looking for something like this:
f = open('task_file','r')
play_source = dict(
name = "Ansible Play",
hosts = '192.168.56.212',
gather_facts = 'no',
tasks = read_tasks_from_file(f.read())
)ansible 2.0.0.2
docker python-2.7