I'm trying to use Python API to run some playbooks because I want to integrate it with Flash to enable the web-base control. Here is my playbook(crondis.yaml):
- hosts: "{{app_name}}-server"
tasks:
- name: disable cron
cron:
name: "{{app_name|upper}}_MONITOR"
job: "/{{app_name}}/monitor.sh"
disabled: yes
From cml that can be this way:
ansible-playbook --extra-vars="{'app_name': 'newapp'}" crondis.yaml
But in the Python API, I'm not seeing any place to add the vars to the play. I checked Variable_Manager, DataLoader and PlaybookExecutor but didn't find any function can add vars to the play. Please kindly shed a little bit light for me if you have any idea.