项目作者: ryankwilliams

项目描述 :
Automation using Ansible AWX for development and test.
高级语言: Python
项目地址: git://github.com/ryankwilliams/awx-test.git
创建时间: 2017-09-26T19:48:16Z
项目社区:https://github.com/ryankwilliams/awx-test

开源协议:GNU General Public License v3.0

下载


AWX-TEST

AWX-test is a project that is based on using the Ansible
tower-cli to perform actions
within 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.

  1. $ vi /etc/tower/tower_cli.cfg
  2. host: http://localhost
  3. username: admin
  4. password: password
  5. verify_ssl: False

Here are some examples on how to use the Python class wrapping tower-cli
library.

  1. from awx import Awx
  2. from pprint import pprint
  3. # create awx object
  4. awx = Awx()
  5. # list all organizations
  6. print(awx.organizations.organizations)
  7. # list all inventories
  8. print(awx.inventory.inventories)
  9. # create organization
  10. awx.organization.create('minions')