Skip to content

rgl/awx-vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

My Ansible AWX playground.

Usage (libvirt/ubuntu-22.04)

Install the Ubuntu 22.04 UEFI Vagrant Box.

Review/Modify the awx.yml playbook.

Bring up the awx vagrant environment (here it takes about 20m to be ready, but YMMV):

time vagrant up --provider=libvirt --no-destroy-on-error --no-tty

Access AWX as admin:admin:

xdg-open "$(cat tmp/awx-url.txt)"

Select one of the Templates and click their Launch (rocket icon) button to execute a playbook.

Follow the next section to manually configure AWX in a similar way as the awx.yml playbook.

Access the AWX REST API Browser:

xdg-open "$(cat tmp/awx-url.txt)/api/"

The API schema swagger document is available at:

https://s3.amazonaws.com/awx-public-ci-files/release_4.6/schema.json

List this repository dependencies (and which have newer versions):

export GITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN'
./renovate.sh

Manual Configure AWX

Follow the next inner sections to manually configure AWX and execute a playbook.

Add Execution Environments

Go to the Administration/Execution Environments/Create new execution environment page:

xdg-open "$(cat tmp/awx-url.txt)/#/execution_environments/add"

Add a new Execution Environment with the following properties:

  • Name: My Ubuntu EE (latest)
  • Image: my-ubuntu-ee:latest
  • Pull: Only pull the image if its not present before running.

NB This image was built in provision-my-ubuntu-ee.sh.

Add a new Execution Environment with the following properties:

  • Name: My Windows EE (latest)
  • Image: my-windows-ee:latest
  • Pull: Only pull the image if its not present before running.

NB This image was built in provision-my-windows-ee.sh.

Add Inventory

Go to the Resources/Inventories/Create new inventory page:

xdg-open "$(cat tmp/awx-url.txt)/#/inventories/inventory/add"

Add a new Inventory with the following properties:

  • Name: My Lab

Click the Hosts tab and add a new Host with the following properties:

  • Name: dm1
  • Variables YAML:
    ---
    ansible_host: 192.168.8.11

And repeat the process for all your hosts.

Add Credentials

Go to the Resources/Credentials/Create New Credential page:

xdg-open "$(cat tmp/awx-url.txt)/#/credentials/add"

Add a new Credential with the following properties:

  • Name: Vagrant (Ubuntu My Lab)
  • Credential Type: Machine
  • Username: vagrant
  • Password: vagrant
  • Privilege Escalation Method: sudo
  • Privilege Escalation Username: vagrant
  • Privilege Escalation Password: vagrant

Add a new Credential with the following properties:

  • Name: Administrator (Windows My Lab)
  • Credential Type: Machine
  • Username: Administrator
  • Password: vagrant

Add Projects

Go to the Resources/Projects/Create New Project page:

xdg-open "$(cat tmp/awx-url.txt)/#/projects/add"

Add a new Project with the following properties:

  • Name: My Ubuntu
  • Execution Environment: My Ubuntu EE (latest)
  • Source Control Type: Git
  • Source Control URL: https://github.com/rgl/my-ubuntu-ansible-playbooks.git
  • Source Control Branch/Tag/Commit: main
  • Options: clean

Add a new Project with the following properties:

  • Name: My Windows
  • Execution Environment: My Windows EE (latest)
  • Source Control Type: Git
  • Source Control URL: https://github.com/rgl/my-windows-ansible-playbooks.git
  • Source Control Branch/Tag/Commit: main
  • Options: clean

Add Templates

Go to the Resources/Templates/Create New Job Template page:

xdg-open "$(cat tmp/awx-url.txt)/#/templates/job_template/add"

Add a new Project with the following properties:

  • Name: My Ubuntu (development)
  • Inventory: My Lab
  • Project: My Ubuntu
  • Playbook: development.yml
  • Credentials: Vagrant (Ubuntu My Lab)
  • Options: Privilege Escalation and Enable Fact Storage

Add a new Project with the following properties:

  • Name: My Windows (development)
  • Inventory: My Lab
  • Project: My Windows
  • Playbook: development.yml
  • Credentials: Administrator (Windows My Lab)
  • Variables YAML:
    ansible_connection: psrp
    ansible_psrp_protocol: http
    ansible_psrp_message_encryption: never
    ansible_psrp_auth: credssp
  • Options: Enable Fact Storage

Execute Playbook

A Playbook is indirectly executed by Launching a Template.

For example, go to the Resources/Templates/My Ubuntu (development) page and click the Launch (the rocket icon) button.

Reference

Alternatives

About

My Ansible AWX playground

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages