rgl / awx-vagrant

My Ansible AWX playground

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

My Ansible AWX playground.

Usage (libvirt/ubuntu-20.04)

Install the Ubuntu 20.04 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 at the returned endpoint. For example:

http://192.168.121.42:30080

Use the admin/admin credentials.

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

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

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. For example:

http://192.168.121.42:30080/#/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. For example:

http://192.168.121.42:30080/#/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.1.77

And repeat the process for all your hosts.

Add Credentials

Go to the Resources/Credentials/Create New Credential page. For example:

http://192.168.121.42:30080/#/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. For example:

http://192.168.121.42:30080/#/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. For example:

http://192.168.121.42:30080/#/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


Languages

Language:Shell 100.0%