From Git Push to Running PostgreSQL: An End-to-End AWX Workflow
81%
Launching the Workflow From the CLI
As we've seen, you can launch jobs using the AWX CLI. In this section, we'll look at another example. We'll use the awx command to launch the DeployAndCheckPostgreSQL workflow job template. I assume you have the awx command installed and authenticated with the AWX server as described in the previous sections.
To launch any sort of job, we need to provide the following:
- The name or the ID of the job template or the workflow job template. In our case, this should be
DeployAndCheckPostgreSQL. - Anything our job needs to run. In our case, this means the inventory, credentials, and survey answers (extra variables).
We're going to use the following commands:
# create a file containing the extra vars
cat < /tmp/extra-vars.json
{
"database_name": "my-database",
"database_user": "my-user",
"database_password": "my-password"
}
EOF
### Steps you can skip if you already have awxkit installed and configured
# Install awxkit
pip3 install awxkit==24.6.1
# Change these values to match your environment
export TOWER_HOST=https://awx.example.com
export TOWER_USERNAME=admin
export TOWER_PASSWORDAWX in Action
Ansible Orchestration at ScaleEnroll now to unlock all content and receive all future updates for free.
