fontsize | code-block-font-size | classoption |
---|---|---|
8pt |
8pt |
landscape |
Usage:
awx-adhoc-get-stdout ADHOC_JOB_ID
Get stdout
of adhoc job
Example
awx-adhoc-get-stdout 1234
Usage:
awx-adhoc-shell INVENTORY LIMIT MODULE_ARGS
Execute commands using shell
module in ad-hoc
of AWX
Example:
awx-adhoc-shell pve dev uptime
Usage:
awx-adhoc-shell-awx-jobs-history INVENTORY LIMIT
Show AWX deploy history in /etc/awx-history/jobs-history.json
Example:
awx-adhoc-shell-awx-jobs-history wst dev
Usage:
awx-adhoc-shell-braa [INVENTORY] [LIMIT] [SUBNET]
Execute braa
to get hostname by SNMP resquest
Example:
awx-adhoc-shell-braa pve dev 10.1.2
Usage:
awx-adhoc-shell-grep-ffox-js INVENTORY LIMIT USER REGEX
Find Firefox preferences
Example:
awx-adhoc-shell-grep-ffox-js wst dev ansible 'network.proxy.*'
Usage:
awx-adhoc-shell-grep-log-sssd INVENTORY LIMIT REGEX
Execute grep REGEX
in SSSD logs
Example:
awx-adhoc-shell-grep-log-sssd wst dev '(0x0010|0x0020|0x0040)'
Usage:
awx-adhoc-shell-hostnamectl-status INVENTORY LIMIT
Execute hostnamectl status
.
Example:
awx-adhoc-shell-hostnamectl-status wst dev
Usage:
awx-adhoc-shell-ping-ip INVENTORY LIMIT IP
Execute ping
to IP from inventory.
Example:
awx-adhoc-shell-ping-ip wst dev 10.1.0.1
Usage:
awx-adhoc-shell-product-serial INVENTORY LIMIT
Show product_serial
from dmi
.
Example:
awx-adhoc-shell-product-serial wst dev
Usage: awx-adhoc-shell-qm-clone
Description
Usage: awx-adhoc-shell-qm-cores
Description
Usage: awx-adhoc-shell-qm-destroy
Description
Usage: awx-adhoc-shell-qm-get-cores
Description
Usage: awx-adhoc-shell-qm-list-running
Description
Usage: awx-adhoc-shell-qm-list-stopped
Description
Usage: awx-adhoc-shell-qm-no-boot
Description
Usage: awx-adhoc-shell-qm-reboot
Description
Usage: awx-adhoc-shell-qm-set-cores
Description
Usage: awx-adhoc-shell-qm-shutdown
Description
Usage: awx-adhoc-shell-qm-start
Description
Usage: awx-adhoc-shell-qm-start-all
Description
Usage: awx-adhoc-shell-set-hostname
Description
Usage: awx-adhoc-shell-sssctl-domain-status
Description
Usage: awx-adhoc-shell-vzdump
Description
Usage:
awx-adhoc-shell-wol [INVENTORY] [LIMIT] [SUBNET]
Execute braa
to get hostname by SNMP resquest
Example:
awx-adhoc-shell-wol pve dev 10.1.2
Usage:
awx-adhoc-stdout JOB_ID
Get stdout
of ad-hoc job.
Example:
awx-adhoc-stdout 1234
Enter passphrase for /tmp/awx_1234_l3bc_2qw/artifacts/1234/ssh_key_data:
Identity added: /tmp/awx_1234_l3bc_2qw/artifacts/1234/ssh_key_data (/tmp/awx_1234_l3bc_2qw/artifacts/1234/ssh_key_data)
sprn01dev | CHANGED | rc=0 >>
Restarting cups (via systemctl): cups.service.
OK. (changed: false)
Usage:
awx-config ENVIRONMENT
Overwrite ~/.tower_cli.cfg
with enviroment config using
~/.awx-config
and pass
command for retrieve passwords to use
with awx-cli
.
First copy .awx-config-example
to ~/.awx-config
, customize
variables according your enviroment.
Example:
awx-config DEVELOP
Write example config:
awx-config -c
BACKUP CURRENT CONFIG IN /home/awx/.awx-config-1653427782.bak
WRITE EXAMPLE CONFIG IN /home/awx/.awx-config
Define enviroments in ~/.awx-config
:
AWX_DEBUG: -v
DEFAULT_AD_DOMAIN: example.com
DEFAULT_CREDENTIAL_TYPE: Machine
DEFAULT_CREDENTIAL_USER: ansible
DEFAULT_DOMAIN: ipa.example.com
DEFAULT_EMAIL_DOMAIN: example.com
DEFAULT_GRANT_CREDENTIAL: use
DEFAULT_GRANT_INVENTORY: use
DEFAULT_GRANT_JOB_TEMPLATE: execute
DEFAULT_GRANT_PROJECT: use
DEFAULT_GRANT_WORKFLOW: execute
DEFAULT_HOST_DOMAIN: example.com
DEFAULT_HOST_DOMAIN_PREFIX: ipa
DEFAULT_HOST_INVENTORY: hosts-pve
DEFAULT_HOST_PREFIX_REPLACE: pve
DEFAULT_HOST_PREFIX_SEARCH: pve01
DEFAULT_HOST_SUFFIX: n0
DEFAULT_IPA_DOMAIN: ipa.example.com
DEFAULT_LIMIT: lab
DEFAULT_ORGANIZATION: example
DEFAULT_PROJECT: inventory_v0.2.2
DEFAULT_SCM_CREDENTIAL: git_awx_dev
DEFAULT_SEP: ,
DEFAULT_SSH_CREDENTIAL: ssh_ansible_dev
DEFAULT_TEAM: devops
DEFAULT_VAULT_CREDENTIAL: vault_dev
DEVELOP: awx-dev
DEVELOP_PASSWORD_STORE_DIR: /home/awx/.password-store-awx-dev
DEVELOP_USER: admin
DEVOPS_GRANT_INVENTORY: admin
DIR_INVENTORY: inventory
DIR_JOB_TEMPLATE: job_template
DIR_PROJECT: project
DIR_WORKFLOW: workflow
ERROR_SHOW_USAGE: 1
LAB: lab
LAB_PASSWORD_STORE_DIR: /home/awx/.password-store-awx-lab
LAB_USER: awx-cli
LO: loawx
LO_USER: admin
MASTER: awx-prd
MASTER_PASSWORD_STORE_DIR: /home/awx/.password-store-awx-prd
MASTER_USER: admin
OUTPUT_STYLE: md
PASS_PREFIX: awx/
PASS_SUFFIX: /
PROJECT_PREFIX: ansible
SCM_URL_API: https://git.example.com/api/v4
SCM_URL_BASE: git@git.example.com:/ipa
SNMP_USER: public
STAGE: awx-stg
STAGE_PASSWORD_STORE_DIR: /home/awx/.password-store-awx-stg
STAGE_USER: admin
WORKFLOW_PREFIX: wfw
Generate or insert credentials in multiple pass
repositories:
export PASSWORD_STORE_DIR=~/.password-store-awx-dev
pass awx/awx-dev/host
pass awx/awx-dev/admin_password
export PASSWORD_STORE_DIR=~/.password-store-awx-prd
pass awx/awx-prd/host
pass awx/awx-prd/admin_password
Config file variables can be overridden on the fly by using them as environment variables
AWX_HOST=awx-dev AWX_USER=admin AWX_PASS=secret awx-config DEVELOP
Usage:
awx-config-clean
Remove ~/.tower_cli.cfg
to prevent unauthorized access.
Example:
awx-config-clean
DELETE /home/osiris/.tower_cli.cfg
Usage:
awx-credential-delete CREDENTIAL_NAME
Delete credential by name.
awx-credential-delete ssh_wst
Usage:
awx-credential-create CREDENTIAL_NAME [SSH_KEY_DATA] [SSH_KEY_UNLOCK]
Create a credential as Machine type by default.
Examples:
Get ssh private key and passphrase from pass
:
PASSWORD_STORE_DIR=~/.password-store-awx awx-credential-create ansible_test
== ============ ===============
id name credential_type
== ============ ===============
26 ansible_test 1
== ============ ===============
Get ssh private key without passphrase from file:
awx-credential-create ansible_test ~/.ssh/ansible_test
Get ssh private key from file and passphrase as argument:
awx-credential-create ansible_test ~/.ssh/ansible_test 'super mega secret'
Usage:
awx-credential-modify CREDENTIAL_NAME [SSH_KEY_DATA] [SSH_KEY_UNLOCK]
Modify a credential as Machine type by default.
Examples:
Get ssh private key and passphrase from pass
:
awx-credential-modify ansible_test
== ============ ===============
id name credential_type
== ============ ===============
26 ansible_test 1
== ============ ===============
Get ssh private key without passphrase from file:
awx-credential-modify ansible_test ~/.ssh/ansible_test
Get ssh private key from file and passphrase as argument:
awx-credential-modify ansible_test ~/.ssh/ansible_test 'super mega secret'
Usage:
awx-csv-host-versions2table CSV
Convert .csv
with host versions to table group by version.
Example:
awx-csv-host-versions2table awx-host-versions.csv
vers v1.0.0 v1.1.0 v1.1.1 v1.1.2 v1.1.3 n01 0 0 19 0 1 n02 0 0 8 0 0 n03 0 0 13 0 0 n04 0 0 15 0 0 n05 2 0 9 0 0 n06 2 0 5 0 0 n07 2 0 5 0 0 n08 1 0 5 0 0 n00 2 0 4 0 0 n09 1 0 6 0 0 n10 4 1 1 2 0
Usage:
awx-csv-host2all CSV [FILTER_NAME] [FILTER_GROUP]
Read CSV and generate files:
-
config
(all hosts order by group and host)Host wst12345 wst01dev Hostname wst01dev.example.com
Host wst12346 wst01prd Hostname wst01prd.example.com
-
groups
(all groups)dev prd
-
host_vars/INVENTORY_HOST.yml
(one file per host)--- ansible_host: 10.0.0.45 primary_maccaddress: ca:fe:ca:fe:01:23 hostname: wst01dev inventory_serial: W31415926
-
hosts
(all hosts in groups)[dev] wst12345 [prd] wst12346
Example:
```bash
awx-csv-host2all wst.csv wst dev
Usage:
awx-deploy-sort FILE
```bash
Order lines that ensure that the dependencies are first on the list.
Example:
cat deploy/update.awx
job_template/wst_wol_v0.1.0.json
project/ansible_wst_v0.1.0.json
inventory/wst.json
credential/ssh_wst.json
awx-deploy-sort deploy/update.awx
credential/ssh_wst.json
project/ansible_wst_v0.1.0.json
inventory/wst.json
job_template/wst_wol_v0.1.0.json
�[38;5;196m[ERROR] NOT FOUND .tower_cli.cfg TRY awx-config �[m�
Usage:
awx-grant-project-use JOB_PROJECT_NAME [TEAM]
Grant with use permission a project to team.
awx-grant-project-use ansible_pve_v0.1.0 devops
Usage:
awx-grant-filter ROLE_FILE TEAM_NAME
Filter grants from ROLE_FILE and generate awx-cli role grant
Example CSV:
RESOURCE_TYPE RESOURCE_NAME TYPE
inventory wst admin
project ansible_wst_v1.6.0 use
job_template wst_upd_v1.6.0 execute
workflow wfw_pve_apt_v1.2.0 execute
Example:
awx-grant-filter role/devops.csv support
## inventory
awx-cli role grant -v --team support --type admin --inventory wst
## project
awx-cli role grant -v --team support --type use --project ansible_wst_v1.6.0
## job_template
awx-cli role grant -v --team support --type execute --job-template wst_upd_v1.6.0
## workflow
awx-cli role grant -v --team support --type execute --workflow wfw_pve_apt_v1.2.0
Usage:
awx-grant-inventory INVENTORY TEAM [TYPE]
Grant (default use
) permission to a team for an inventory
awx-grant-inventory pve devops
Usage:
awx-grant-inventory-admin INVENTORY_NAME TEAM_NAME
Grant admin role to team in inventory.
Example:
awx-grant-inventory-admin pve sysadmins
Usage:
awx-grant-inventory-use INVENTORY_NAME TEAM_NAME
Grant use role to team in inventory.
Example:
awx-grant-inventory-use pve devops
Usage:
awx-grant-job-template JOB_TEMPLATE [TEAM]
Grant permission to a team for a job_template.
awx-grant-job-template wst_wol_v0.1.0 devops
``
### `awx-grant-json-all`
Usage:
```bash
awx-grant-json-all [TEAM]
Grant default permissions to all JSON files (in the current directory) to a specified team (if not specified, the default team will be used)
awx-grant-json-all devops
Usage:
awx-grant-project PROJECT_NAME [TEAM|defaut_team] [TYPE|use]
Grant permissions to a team for a project.
Use default team defined in config and use
as default permission.
awx-grant-project ansible_wst_v1.0.0 devops
Resource changed.
==== ==== ==== =======
id team type project
==== ==== ==== =======
3268 7 use 727
==== ==== ==== =======
Usage:
awx-grant-workflow
Grant permission to a team for a workflow.
awx-grant-workflow
Usage:
awx-grant-version VERSION_FILE [TEAM]
Grant use and execute permissions to a project, job template and workflow defined in version file to team.
awx-grant-version wfw_pve_v0.1.0.version devops
Usage:
awx-grant-job-template-admin JOB_TEMPLATE_NAME [TEAM]
Grant with admin permission a job template to team.
awx-grant-job-template-admin pve_vms_kvm sysadmins
Usage:
awx-grant-workflow-execute
Grant with execute permission a workflow to team.
Example:
awx-grant-workflow-execute wfw_pve_kvm_v0.1.0 devops
Usage:
awx-grant-job-template-execute JOB_TEMPLATE_NAME [TEAM]
Grant with execute permission a job template to team.
awx-grant-job-template-execute pve_vms_kvm devops
Usage:
awx-grant-project-admin JOB_PROJECT_NAME [TEAM]
Grant with admin permission a project to team.
awx-grant-project-admin ansible_pve_v0.1.0 sysadmins
Usage:
awx-grant-team GRANT_FILE
Generate awx-cli role grant from grant file
Example file:
RESOURCE_TYPE RESOURCE_NAME TYPE TEAM
inventory wst admin devops
project ansible_wst_v1.6.0 use devops
job_template wst_upd_v1.6.0 execute devops
workflow wfw_pve_apt_v1.2.0 execute devops
Example:
awx-grant-team role/devops.awx devops
awx-cli role grant -v --team devops --type admin --inventory wst
awx-cli role grant -v --team devops --type use --project ansible_wst_v1.6.0
awx-cli role grant -v --team devops --type execute --job-template wst_upd_v1.6.0
awx-cli role grant -v --team devops --type execute --workflow wfw_pve_apt_v1.2.0
Usage:
awx-group-get-variable INVENTORY GROUP [VARIABLE|all]
Description
Example:
awx-group-get-variable wst dev
Usage: awx-group-modify-variable
Description
Usage:
awx-group-diff-variables INVENTORY GROUP
Compare and merge AWX group variables with local YAML group file.
Example:
awx-group-diff-variables wst dev
Usage:
awx-help
Generate a markdown output for usage of each command script
Usage:
awx-host-associate HOST GROUP_NAME [INVENTORY]
```bash
Associate _host_ to _group_.
Use PREFIX-HOST as INVENTORY.
```bash
awx-host-associate wst-dev01 dev
awx-host-associate wstdev01 dev wst
Usage:
awx-host-get-variable HOST [KEY|all] [INVENTORY|prefix-]
Get host variables from inventory
Example:
Implicit inventory from host:
awx-host-get-variable pve-dev01
Get value of ansible_host
from host:
awx-host-get-variable pve-dev01 ansible_host
Explicit host, all variables and inventory:
awx-host-get-variable dev01 all pve
Usage:
awx-host-associate-host-vars INVENTORY REGEXP GROUP
Associate host to group based on variables in host_vars
directory.
Example:
awx-host-associate-host-vars pve REGEXP dev
Usage:
awx-host-create INVENTORY_HOSTNAME [INVENTORY]
Create host in inventory.
Example:
awx-host-create wst-dev01
awx-host-create wstdev001 wst
Usage:
awx-host-disable HOST_NAME INVENTORY_NAME
Disable host from inventory.
Example:
awx-host-disable spve01 pve
Usage:
awx-host-disable-all [INVENTORY]
Disable all enabled hosts in inventory.
Example:
awx-host-disable-all pve
Usage:
awx-host-enable HOST [INVENTORY]
Enable host in inventory.
Example:
Implicit inventory from host:
awx-host-enable pve-dev01
Explicit host and inventory:
awx-host-enable dev01 pve
Result:
=== ========= ========= =======
id name inventory enabled
=== ========= ========= =======
123 pve-dev01 2 true
=== ========= ========= =======
Usage: awx-host-enable-all
Description
Usage:
awx-host-get-by-description DESCRIPTION [INVENTORY]
Get host by description
.
Return: id name enabled ansible_host primary_macaddress
Example:
awx-host-get-by-description wst050f0247 wst
12345 wst-ACDCFAFAFA true 10.10.1.22 ca:fe:ac:dc:fa:fa
Usage:
awx-host-get-ip [HOST]
Get IP Address from ansible_host
in host_vars of AWX.
Example:
awx-host-get-ip gateway
10.1.2.1
Usage:
awx-host-get-recent-jobs
Description
awx-host-get-recent-jobs
Usage:
awx-host-modify-from-yaml HOST YAML INVENTORY
Modify host variable providing .yaml
file.
Example:
awx-host-modify-from-yaml pve-dev01
Usage: awx-host-modify-ip
Description
Usage: awx-host-modify-variable
Description
Usage:
awx-host-vars2ssh-config HOST_VARS_YAML
Generate SSH host config from host_vars YAML file.
Example:
awx-host-vars2ssh-config host_vars/wstdev01.yml
Usage:
awx-host-get-description HOST [INVENTORY]
Get host description from AWX inventory.
Example:
Implicit inventory from host:
awx-host-get-description pve-dev01
Proxmox develop server
Explicit host and inventory:
awx-host-get-description dev01 pve
Proxmox develop server
### `awx-host-get-last-job-summary`
Usage:
```bash
awx-host-get-last-job-summary HOST [INVENTORY]
Get summary fields last job executed in host using curl
.
Example:
awx-host-get-last-job-summary wst01n01 wst
1234 wst_apt_v1.1.0 failed true 43.514 888 wst_apt_v1.1.0
Usage:
awx-host-get-csv HOST_NAME [INVENTORY]
Get .csv
with basic attributes of host.
inventory_host,description,ansible_host,primary_macaddress,inventory_serial
Example:
awx-host-get-csv wst01dev01 wst
'wst01dev01','imported','192.168.1.11','ca:fe:ca:fe:00:3d','S12345678'
'wst01dev02','imported','192.168.1.12','fa:fa:fa:02:ac:dc','S12345679'
Usage:
awx-host-get-groups HOST [INVENTORY]
Get associated groups to a host.
Example:
Implicit inventory from host:
awx-host-get-groups wst-dev01
wst
n01
Explicit host and inventory:
awx-host-get-groups wst01n01 wst
wst
n01
Usage:
awx-host-list-inventory-group INVENTORY GROUP_ID
Get enabled hosts in group of inventory.
Example:
awx-host-list-inventory-group wst 123
150 wstdev01
151 wstdev02
152 wstdev03
153 wstdev04
Usage:
awx-host-replace-ansible-host [HOST_INVENTORY]
Replace ansible_host
value with FQDN in host_vars YAML files of inventory.
Example:
awx-host-replace-ansible-host hosts-pve
Usage:
awx-host-list INVENTORY
Get all hosts in inventory.
Example:
awx-host-list wst
id name enabled
150 wstdev01 true
151 wstdev02 false
152 wstdev03 true
153 wstdev04 true
Usage:
awx-install-apt
Install dependencies using apt on Debian based distros
awx-install-apt
Usage:
awx-inventory-source-update INVENTORY_SOURCE
Update inventory source of inventory
Example:
awx-inventory-source-update inventory_pve
Usage:
awx-inventory-get-variable INVENTORY VARIABLE
Get variable value from inventory.
Example:
awx-inventory-get-variable pve subnet
Usage:
awx-inventory-source-get-variable INVENTORY_SOURCE [KEY|all]
Get variable from inventory_source.
awx-inventory-source-get-variable inventory_pve source_path
hosts-pve
Usage: awx-inventory-batch-update
Description
Usage:
awx-inventory-create INVENTORY DESCRIPTION ORGANIZATION
```bash
Create _inventory_
```bash
awx-inventory-create pve Proxmox
Usage:
awx-inventory-get-id INVENTORY
Get id
of inventory
Example:
awx-inventory-get-id pve
Usage:
awx-inventory-group-get-hosts INVENTORY GROUP
Get hosts from group of inventory
Example:
awx-inventory-group-get-hosts pve dev
spve01dev
Usage:
awx-inventory-list
List all inventories.
Usage: awx-inventory-modify-variable
Description
Usage: awx-inventory-set-description
Description
Usage:
awx-inventory-source-create INVENTORY PROJECT
```bash
Create _inventory_source_
```bash
awx-inventory-source-create pve inventory_v0.1.0
Usage: awx-inventory-source-get-project
Description
Usage: awx-inventory-source-modify-variable
Description
Usage: awx-inventory-source-set-project
Description
Usage:
awx-inventory-delete INVENTORY_NAME
Delete inventory by name.
awx-inventory-delete wst
Usage:
awx-job-template-get JOB_ID
Get summary of job_template execution in format:
name duration date start finish url
awx-job-template-get 1234
vms_cin_v0.2.0 00:00 2022-05-17 17:47 17:47 http://awx-dev/#/jobs/playbook/1234
``
### `awx-job-template-create`
Usage:
```bash
awx-job-template-create JOB_TEMPLATE PROJECT_NAME PLAYBOOK_FILE [EXTRA_VARS_YAML]
Create job template and associate default credentials in AWX.
awx-job-template-create wst_wol_v0.1.0 ansible_wst_v0.1.0 wst-wol.yml wst_extra_vars.yml
Usage:
awx-job-list-running
List current running jobs
Usage: awx-job-stdout
Description
Usage: awx-job-template-get-last-failed-jobs
Description
Usage: awx-job-template-get-last-job
Description
Usage: awx-job-template-get-last-job-status
Description
Usage: awx-job-template-get-url
Description
Usage: awx-job-template-get-variable
Description
Usage:
awx-job-template-get-recent-jobs
Get job_template
recent jobs.
Return job ID, timestamp and status of each job.
Example:
awx-job-template-get-recent-jobs wst_wol_v0.1.0
137020 2021-11-29 13:27:45 successful
136982 2021-11-29 08:15:40 successful
136877 2021-11-25 13:05:05 successful
136799 2021-11-25 09:12:57 successful
136793 2021-11-24 20:17:46 successful
136720 2021-11-24 10:31:45 successful
136719 2021-11-24 10:24:43 successful
136709 2021-11-24 08:50:15 successful
136696 2021-11-23 16:18:26 successful
136683 2021-11-23 12:59:12 successful
Usage:
awx-job-status JOB_ID
Show status of job
awx-job-status 678
========== ====== =======
status failed elapsed
========== ====== =======
successful false 379.13
========== ====== =======
Usage:
awx-job-overview JOB_ID
Get overview of job execution.
Example:
awx-job-overview 1234
| 1234 | wst_ap_v1.1.0 | failed | 43.514 | | 2021-05-10 | 17:04:32 | 17:05:15 | 00:00:43 | test |
Usage:
awx-job-template-delete JOB_TEMPLATE
Delete job template.
awx-job-template-delete wst_wol_v0.1.0
Usage:
awx-job-launch JOB_NAME [JOB_LIMIT]
Launch job template with limit.
Example:
awx-job-launch wst_wlp_v1.0.0 dev
Usage:
awx-json-inventory-group-get-hosts INVENTORY.json GROUP
Get hosts from group of inventory .json
file
Example:
awx-json-inventory-group-get-hosts inventory/pve.json dev
spve01dev
Usage:
awx-json-inventory-get-variables [INVENTORY]
Get variables of inventory .json
file
Example:
awx-json-inventory-get-variables inventory/pve.json
remote_user: ansible
http_proxy_host: 10.0.0.1
http_proxy_port: 3128
Usage:
awx-json-bump-version JSON
Increment semantic version in .json
file.
Usage: awx-json-bump-version-unified-job-name
Description
Usage: awx-json-get-ask-inventory-on-launch
Description
Usage: awx-json-get-ask-limit-on-launch
Description
Usage:
awx-json-get-dependencies JSON
Get dependencies of .json
file and write a .version
file with
properties.
Example:
awx-json-get-dependencies workflow/wfw-pve.json
Usage: awx-json-get-job-template
Description
Usage:
awx-json-inventory-group-subgroup-get-hosts INVENTORY.json GROUP SUBGROUP
Get hosts from subgroup of group of inventory .json
file
Example:
awx-json-inventory-group-subgroup-get-hosts inventory/pve.json dev lab
spve01dev
Usage: awx-json-get-project
Description
Usage: awx-json-get-unified-job-name
Description
Usage:
awx-json-inventory-get-groups [INVENTORY]
Get groups of inventory .json
file
Example:
awx-json-inventory-get-groups inventory/pve.json
dev
prd
Usage:
awx-json-inventory2all [INVENTORY_JSON] GROUP
Generate hosts inventory file and ssh config from inventory .json
Example:
awx-json-inventory2all inventory/pve.json
inventory hosts:
[pve]
spve01dev
spve01prd
[dev]
spve01dev
[prd]
spve01prd
ssh config:
Host spve01dev
Hostname spve01dev.example.com
Host spve01dev
Hostname spve01dev.example.com
Usage:
awx-json-inventory-get-subgroups [INVENTORY_JSON] GROUP
Get groups of inventory .json
file
Example:
awx-json-inventory-get-subgroups inventory/pve.json
dev
prd
Usage:
awx-json-inventory-group-get-variables INVENTORY.json GROUP
Get hosts from group of inventory .json
file
Example:
awx-json-inventory-group-get-variables inventory/pve.json dev
spve01dev
Usage:
awx-json-inventory-group-host-verify GROUP_HOST_FILE INVENTORY_JSON
Get hosts from group of inventory json
file.
Example:
awx-json-inventory-group-host-verify pve-deploy pve.json
spve01dev
Usage:
awx-json-inventory-group-hosts GROUPS_FILE INVENTORY_JSON
Get hosts from group file of inventory.
Example:
awx-json-inventory-group-hosts pvedeploy pve.json
dev pve-dev-01
prd pve-prd-01
prd pve-prd-02
Usage:
awx-json-get-extra-vars JSON
Get extra_vars from .json
.
awx-json-get-extra-vars job_template/ipa_sss_syn_v0.1.0.json
---
sssd_cache_script_path: /opt/freeipa-sssd-tools/ipa-sss-syn
sssd_cache_rt_path: /opt/freeipa-sssd-tools
Usage: awx-json-receive-inventory
Description
Usage: awx-json-receive-job-template
Description
Usage: awx-json-receive-project
Description
Usage: awx-json-receive-workflow
Description
Usage:
awx-json-rename JSON NEW_NAME
Rename .json
file and replace internal name
.
Example:
awx-json-rename pve_kvm.json pve_vms_kvm
Usage:
awx-json-role-team-list ROLE_TEAM.json
Get grants from unique TEAM ROLE in .json
file
Example:
awx-json-role-team-list role/ROLE_TEAM.json
Usage:
awx-json-send-all
Send to AWX al .json
files (projects, job_templates and
workflows).
Usage: awx-json-send-inventory
Description
Usage: awx-json-send-job-templates
Description
Usage:
awx-json-send-workflows [JSON]
Send to AWX one or multiples workflow and workflows dependencies.
Without file, scan .json
files with WORKFLOW_PREFIX
in
WORKDIR
.
Default Variables in ~/.awx-config
DIR_WORKFLOW: workflow
WORKFLOW_PREFIX: wfw
Example:
awx-json-send-workflows workflow/wfw_pve_v0.1.0.json
Usage:
awx-json-get-playbook [JSON_LIST]
Get playbook from one or more job template .json
file.
awx-json-get-playbook job_template/wst_apt_v1.1.0.json
main.yml
Usage:
awx-json-job-template-add-suffix
Add suffix to job_template with project and show diff
Example:
awx-json-job-template-add-suffix job_template/wst_wol_v0.1.0.json hotfix
RENAME FROM job_template/wst_wol_v0.1.0.json TO job_template/wst_wol_v0.1.0-hotfix.json
"name": "wst_wol_v0.1.0", | "name": "wst_wol_v0.1.0-hotfix",
REPLACE ansible_wst_v1.0.0 WITH ansible_wst_v1.0.0-hotfix
DIFF job_template/wst_wol_v0.1.0.json WITH job_template/wst_wol_v0.1.0-hotfix.json
"name": "wst_wol_v0.1.0", | "name": "wst_wol_v0.1.0-hotfix",
"project": "ansible_wst_v1.0.0", | "project": "ansible_wst_v1.0.0-hotfix",
Usage:
awx-json-inventory-get-csv INVENTORY_JSON [REGEX]
Get .csv
with hosts of each group of inventory .json
file.
Optionally filter groups by regular expression.
inventory_host,description,ansible_host,primary_maccadress,inventory_serial
Example:
awx-json-inventory-get-csv inventory/wst.json
'wst01dev01','imported','192.168.1.11','ca:fe:ca:fe:00:3d','S12345678'
'wst01dev02','imported','192.168.1.12','fa:fa:fa:02:ac:dc','S12345679'
Usage:
awx-json-modify-verbosity JSON VERBOSITY
Modify verbosity in .json
file.
awx-json-modify-verbosity pve_kvm.json 1
BACKUP job_template/pve_kvm.json TO /tmp/tmp.YKCruLt5xb.json
"verbosity": 2, | "verbosity": 1,
Usage:
awx-json-get-limit JSON
Get limit of job_template or workflow .json
.
Example:
awx-json-get-limit job_template/ipa_sss_syn_v0.1.0.json
ipa
Usage:
awx-json-workflow-add-suffix WORKFLOW_JSON
Add suffix to workflow with dependencies and show diff
Example:
awx-json-workflow-add-suffix workflow/wfw_pve_v0.2.0.json hotfix
RENAME FROM workflow/wfw_pve_v0.2.0.json TO workflow/wfw_pve_v0.2.0-hotfix.json
"name": "wfw_pve_v0.2.0" | "name": "wfw_pve_v0.2.0-hotfix"
REPLACE wfw_ftp_v0.2.0 WITH wfw_ftp_v0.2.0-hotfix
REPLACE wfw_git_v0.1.0 WITH wfw_git_v0.1.0-hotfix
REPLACE wfw_cdn_v0.2.0 WITH wfw_cdn_v0.2.0-hotfix
REPLACE wfw_apt_v1.1.3 WITH wfw_apt_v1.1.3-hotfix
DIFF workflow/wfw_pve_v0.2.0.json WITH workflow/wfw_pve_v0.2.0-hotfix.json
"unified_job_name": "wfw_ftp_v0.2.0", | "unified_job_name": "wfw_ftp_v0.2.0-hotfix",
"unified_job_name": "wfw_git_v0.1.0", | "unified_job_name": "wfw_git_v0.1.0-hotfix",
"unified_job_name": "wfw_cdn_v0.2.0", | "unified_job_name": "wfw_cdn_v0.2.0-hotfix",
"unified_job_name": "wfw_apt_v1.1.3", | "unified_job_name": "wfw_apt_v1.1.3-hotfix",
"name": "wfw_pve_v0.2.0" | "name": "wfw_pve_v0.2.0-hotfix"
Usage:
awx-json-get-description JSON
Get description of job_template or workflow .json
.
Example:
awx-json-get-description job_template/ipa_sss_tol_v0.2.4.json
Install and configure FreeIPA Tools with API Queue Syn
Usage:
awx-json-rename.bak JSON NEW_NAME
Rename .json
file and replace internal name
.
awx-json-rename.bak pve_kvm.json pve_vms_kvm
Usage:
awx-json-receive-credential CREDENTIAL_NAME
Get credential from AWX and save in .json
file.
awx-json-receive-credential ssh_ansible
Usage: awx-json-workflow-get-url
Description
Usage:
awx-json-inventory-get-inventory-name [INVENTORY_JSON]
Get name of inventory_source from inventory .json
file.
Example:
awx-json-inventory-get-inventory-name inventory/pve.json
inventory_pve
Usage:
awx-json-inventory-get-inventory-source [INVENTORY_JSON]
Get inventory_source from inventory .json
file.
Example:
awx-json-inventory-get-inventory-source inventory/pve.json
inventory_v0.1.0
Usage:
awx-json-workflow-nodes SRC_YML AWX_YML
Show workflow nodes grouped by common nodes
Example:
awx-json-workflow-nodes workflow/wfw_pve_vms_v0.2.2.json
wfw_vms_ans_v0.2.4 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_ans_v0.2.2
wfw_vms_ftp_v0.2.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_ftp_v0.2.0
wfw_vms_pxe_v0.5.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_pxe_v0.5.0
wfw_vms_log_v0.1.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_log_v0.1.0
wfw_vms_git_v0.1.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_git_v0.3.1
wfw_vms_prn_v0.1.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_prn_v0.1.0
wfw_vms_cdn_v0.2.2 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_cdn_v0.2.0
wfw_vms_apt_v1.10.4 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_apt_v1.10.2
wfw_vms_rep_v0.1.1 apt_set_v0.1.1 vms_acs_v0.1.0 vms_cin_v0.2.0 vms_rep_v0.1.0
Usage:
awx-log-version2png [STDOUT_JOB_FILE]
Plot hosts versions group by network from stdout job file.
Example:
awx-log-version2png 12345.log
Usage:
awx-log-get-host-last-job JOB_LOG_FILE
Get last job of awx_history_stdout in job .log
file.
Example:
awx-log-get-host-last-job 12345.log
wstdev01 wfw_wst_upd_v1.2.0
wstdev02 wfw_wst_upd_v1.3.0
Usage:
awx-log-host-get-data JOB_LOG_PATTERN
Get group, description, inventory_host and last job of awx_history_stdout in multiples job .log
files.
Example:
awx-log-host-get-data 12*.log
dev wstdevelop01 wstdev01 wfw_wst_upd_v1.2.0
dev wstdevelop02 wstdev02 wfw_wst_upd_v1.3.0
Usage:
awx-organization-create NAME [DESCRITION]
```bash
Create _organization_
```bash
awx-organization-create example
Usage:
awx-pass ENVIRONMENT
Get AWX credentials for environment according ~/.awx-config
.
Example:
awx-pass develop
Usage: gnuplot [OPTION] ... [FILE] for X11 options see 'help X11->command-line-options' -V, --version -h, --help -p --persist -s --slow -d --default-settings -c scriptfile ARG1 ARG2 ... -e "command1; command2; ..." gnuplot 5.4 patchlevel 1
Usage: gnuplot [OPTION] ... [FILE] for X11 options see 'help X11->command-line-options' -V, --version -h, --help -p --persist -s --slow -d --default-settings -c scriptfile ARG1 ARG2 ... -e "command1; command2; ..." gnuplot 5.4 patchlevel 1
Usage: awx-project-create
Description
Usage:
awx-project-disable-scm-clean PROJECT_NAME
Set scm_clean = False
in project attributes to disable update
repository when job_template launch.
Example:
awx-project-disable-scm-clean myproject
Usage: awx-project-get-last-job
Description
Usage: awx-project-get-url
Description
Usage:
awx-project-get-variable project_name [variable_name]
Get variable value from project.
Usage: awx-project-list-name
List all projects
Usage: awx-project-modify-scm-branch
Description
Usage: awx-project-update
Description
Usage:
awx-project-delete PROJECT_NAME
Delete project by name.
awx-project-delete ansible_wst_v0.1.0
Usage:
awx-project-sync PROJECT_NAME
Update project when scm_revision
don't match with last commit of current branch
Example:
awx-project-sync ansible_freeipa_sssd_tools_v0.4.0
GET SCM_REVISION FROM PROJECT ansible_freeipa_sssd_tools_v0.4.0
PROJECT ansible_freeipa_sssd_tools_v0.4.0 OK LAST_COMMIT (ce779df11eda84e977c1926bf2ce34bfedcf6327) = SCM_REVISION (ce779df11eda84e977c1926bf2ce34bfedcf6327)
NEXT_TAG=v0.2.2 awx-project-sync
GET SCM_REVISION FROM PROJECT ansible_freeipa_sssd_tools_v0.2.2
BRANCH feature/start-restart-services LAST COMMIT (ce779df1) != PROJECT SCM REVISION (ddcb8feb)
UPDATE PROJECT ansible_freeipa_sssd_tools_v0.2.2
Resource changed.
===== ==== ======== ======= ==========
id name scm_type scm_url local_path
===== ==== ======== ======= ==========
24546 N/A N/A N/A N/A
===== ==== ======== ======= ==========
WAITING UPDATE ...
GET SCM_REVISION FROM PROJECT ansible_freeipa_sssd_tools_v0.2.2
BRANCH feature/start-restart-services LAST COMMIT (ce779df1) != PROJECT SCM REVISION (ddcb8feb)
UPDATE PROJECT ansible_freeipa_sssd_tools_v0.2.2
Resource changed.
===== ==== ======== ======= ==========
id name scm_type scm_url local_path
===== ==== ======== ======= ==========
24547 N/A N/A N/A N/A
===== ==== ======== ======= ==========
WAITING UPDATE ...
GET SCM_REVISION FROM PROJECT ansible_freeipa_sssd_tools_v0.2.2
[ERROR] TOO MANY UPDATES, CANCEL SYNC
Usage:
'''bash
awx-role-list-job-template JOB_TEMPLATE [TEAM]
'''
List
Example:
'''bash
awx-role-list-job-template pve-udp-v0.1.0 devops
'''
Usage:
awx-setting-get-custom-login-info
Get `CUSTOM_LOGIN_INFO from AWX settings.
Return:
DEVELOP
Usage:
awx-setting-get-tower-url-base
Get TOWER_URL_BASE
from AWX settings.
Return:
https://awx.local/
Usage:
awx-setting-list-system
List AWX settings
Usage:
awx-shell-check
Check syntax using shellcheck. Group errors by code in result.
Example:
awx-shell-check
awx-shell-check SC2034
awx-team-create SC2034 SC2236
Usage:
awx-team-associate-from-csv CSV
Associate user to team specified in .csv
file.
Example:
awx-team-associate-from-csv awx-users.csv
```bash
### `awx-team-associate`
Usage:
```bash
awx-team-associate USERNAME [TEAM]
Associate user to team.
Example:
awx-team-associate junior devops
```bash
### `awx-team-create`
Usage:
awx-team-create
Description
## `awx user` commands
### `awx-user-modify-is-superuser`
Usage:
```bash
awx-user-modify-is-superuser USERNAME [SUPERUSER]
Modify user type as SysAdmin
Example:
awx-user-modify-is-superuser elliot
awx-user-modify-is-superuser dom false
Usage:
awx-user-get USERNAME
Get user from AWX
Example:
awx-user-get admin
== ======== ================= ========== ========= ============ =================
id username email first_name last_name is_superuser is_system_auditor
== ======== ================= ========== ========= ============ =================
1 admin admin@example.com Sys Admin true false
== ======== ================= ========== ========= ============ =================
Usage: awx-user-create
Description
Usage: awx-user-delete
Description
Usage:
awx-user-list
List all users.
Usage:
awx-vault-check YAML
Check if the AWX vaults are unbalanced in the YAML file and exit with 0 when balanced or exit with error showing unbalanced pattern totals.
Expected format:
variable_name:
__ansible_vault: |
$ANSIBLE_VAULT;1.2;AES256;dev
31415926535897932384626433832795028841971693993751058209749445923078164062862089
98628034825342117067982148086513282306647093844609550582231725359408128481117450
28410270193852110555964462294895493038196442881097566593344612847564823378678316
52712019091456485669234603486104543266482133936072602491412737245870066063155881
7488
Example:
awx-vault-check group_vars/all.yml
[ERROR] UNBALANCED (3) __ansible_vault VS (4) $ANSIBLE_VAULT;[0-9.]+;AES256;[a-z]+$
Usage:
awx-vault2yml YAML
Convert AWX vault format to YAML format.
Example:
awx-vault2yml host_vars/spvedev01.yml
Usage:
awx-vault2yml YAML
Convert AWX vault format to YAML format.
Example:
awx-vault2yml host_vars/spvedev01.yml
Usage: awx-version-get-files
Description
Usage: awx-version-get-status
Description
Usage: awx-version-get-urls
Description
Usage: awx-version-get-urls-md
Description
Usage: awx-version-list
Description
Usage: awx-version-send
Description
Usage: awx-version-tar-dependencies
Description
Usage: awx-workflow-job-get
Description
Usage:
awx-workflow-job-summary WORKFLOW_JOB_ID
Get summary of workflow_job
execution.
Example:
awx-workflow-job-summary
awx-workflow-job-summary 143
=== ================== ====== ========== ======================== =======
id name type status created elapsed
=== ================== ====== ========== ======================== =======
144 vms_bak_dsk_v0.3.0 job successful 2021-11-30T18:54:13.7518 19.166
146 vms_rbt_wfr_v0.1.0 job successful 2021-11-30T18:54:33.5181 185.63
147 vms_apt_upd_v0.1.0 job successful 2021-11-30T18:57:39.7561 14.068
149 vms_crn_rsy_v0.4.0 job successful 2021-11-30T18:57:54.4358 18.851
151 vms_nfs_own_v0.4.0 job successful 2021-11-30T18:58:13.9210 24.452
=== ================== ====== ========== ======================== =======
Usage:
awx-workflow-job-get-hosts WORKFLOW_JOB_ID
Get enabled hosts of limit groups from workflow_job
Example:
awx-workflow-job-get-hosts 123
dev wstdev01
dev wstdev02
dev wstdev03
lab wstlab01
lab wstlab02
Usage:
awx-workflow-job-get-limit WORKFLOW_JOB_ID
Get limit of workflow_job.
Example:
awx-workflow-job-get-limit 123
dev
lab
Usage:
awx-workflow-job-overview WORKFLOW_JOB_ID
Get overview of workflow job execution and nodes.
Example
awx-workflow-job-overview 143
| 143 | wfw_vms_bak_v0.4.1 | successful | 265.368 | 100.00 % | 2021-11-30 | 15:54:13 | 15:58:38 | 00:04:25 | dev |
| 144 | vms_bak_dsk_v0.3.0 | successful | 19.166 | 7.00 % | 2021-11-30 | 15:54:14 | 15:54:33 | 00:00:19 | dev |
| 146 | vms_rbt_wfr_v0.1.0 | successful | 185.63 | 69.00 % | 2021-11-30 | 15:54:33 | 15:57:39 | 00:03:05 | dev |
| 147 | vms_apt_upd_v0.1.0 | successful | 14.068 | 5.00 % | 2021-11-30 | 15:57:40 | 15:57:54 | 00:00:14 | vms |
| 149 | vms_crn_rsy_v0.4.0 | successful | 18.851 | 7.00 % | 2021-11-30 | 15:57:54 | 15:58:13 | 00:00:18 | vms |
| 151 | vms_nfs_own_v0.4.0 | successful | 24.452 | 9.00 % | 2021-11-30 | 15:58:14 | 15:58:38 | 00:00:24 | vms |
Usage:
awx-workflow-job-status WORKFLOW_JOB_ID
Show status of workflow job
awx-workflow-job-status 678
========== ====== =======
status failed elapsed
========== ====== =======
successful false 434.405
========== ====== =======
Usage: awx-workflow-get-last-job
Description
Usage: awx-workflow-get-variable
Description
Usage:
awx-workflow-job-launch WORKFLOW
Launch workflow
Example:
awx-workflow-job-launch wfw_pve
Usage:
awx-workflow-list
List all workflows.
Usage:
awx-workflow-delete WORKFLOW
Delete workflow.
awx-workflow-delete wfw_pve_pvs_v0.2.2
Usage:
awx-yml-diff SRC_YML AWX_YML
Compare and merge AWX group variables with local YAML group file.
Example:
awx-yml-diff group_vars/prn.yml group_vars/ftp.yml
| `key ` | `group_vars/prn.yml ` | ` group_vars/ftp.yml ` |
|-----------------------------|----------------------------|-----------------------------|
| ` ansible_host` | ` {{ sprn_ip }}` | **` {{ sftp_ip }}`** |
| ` apt_setup_proxy` | ` true` | ` true` |
| ` apt_setup_proxy_ip` | ` {{ subnet }}.1` | ` {{ subnet }}.1` |
| ` apt_setup_source` | ` true` | ` true` |
| ` cups_lpadmin_users` | ` ["root"]` | **` null`** |
| ` sftp_client_local_user` | ` null` | **`{{ sftp_local_user }}`** |