30 Juil 2019

Launch AWX / Tower job by name

Category: Ansible,AWX,TOWEREnky @ 13 h 37 min

It’s easy, just use this URL http://awx/api/v2/job_templates/[JOB_NAME]/launch/ and replace [JOB_NAME] by the name of the job in AWX

curl --request POST \
  --url http://awx/api/v2/job_templates/[JOB_NAME]/launch/ \
  --header 'authorization: Basic YWRtaW46YWRtaW4=' \
  --header 'content-type: application/json' \
  --data '{
  "extra_vars": {
    "extra_var_1": "AndThen",
    "extra_var_2": "YouDie",
  }
}
'