https://github.com/ryankwilliams/awx-test
Automation using Ansible AWX for development and test.
https://github.com/ryankwilliams/awx-test
awx awx-test tower-cli
Last synced: 4 months ago
JSON representation
Automation using Ansible AWX for development and test.
- Host: GitHub
- URL: https://github.com/ryankwilliams/awx-test
- Owner: ryankwilliams
- License: gpl-3.0
- Created: 2017-09-26T19:48:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-12T10:56:04.000Z (almost 7 years ago)
- Last Synced: 2024-12-27T09:42:37.914Z (6 months ago)
- Topics: awx, awx-test, tower-cli
- Language: Python
- Homepage:
- Size: 87.9 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWX-TEST
AWX-test is a project that is based on using the Ansible
[tower-cli](https://github.com/ansible/tower-cli) to perform actions
within [AWX](https://github.com/ansible/awx). It provides you with a
simple Python class which uses tower-cli to run its available commands.## Benefit
One of the main reasons for the Python class is that each of the
tower-cli commands require objects from other tower-cli commands.
For example: when creating an inventory you need to have the
organization id to associate the inventory too. You cannot pass the
name of the organization in string format. This requires you too
create an object for organization resource, get the organization object
and return the organization id to create an inventory. There was also
checks needed to see if the organization was valid, etc. This class
allows all commands (organization, host, etc) to have access to the
required commands it may need.## Usage
It is recommended that you configure your tower_cli.cfg file with your
authentication details for accessing your AWX instance.```bash
$ vi /etc/tower/tower_cli.cfghost: http://localhost
username: admin
password: password
verify_ssl: False
```Here are some examples on how to use the Python class wrapping tower-cli
library.```python
from awx import Awx
from pprint import pprint# create awx object
awx = Awx()# list all organizations
print(awx.organizations.organizations)# list all inventories
print(awx.inventory.inventories)# create organization
awx.organization.create('minions')
```