This repository contains content that I use to setup Ansible Tower / Ansible Automation Platform environments.
Make sure to do the following prior to running any playbook within this repository.
-
Install the following programs
-
python3 -m venv .env && ./.env/bin/pip install --upgrade 'ansible-core<2.17' pip setuptools -
jq
-
Obtain an Ansible Automation Platform manifest file
-
Get offline access token from https://console.redhat.com/ansible/automation-hub/token
-
Setup a
$HOME/.config/openstack/clouds.yaml -
Make sure that the SSH key name, within OpenStack, is following
${USERNAME}-rsa
-
Initialize terraform
terraform init -
Create a
terraform.tfvarsfile using the providedterraform.tfvars.examplefilecp terraform.tfvars.example terraform.tfvars -
Fill out the
terraform.tfvarsfile -
Apply the configuration to Openstack
terraform apply -auto-approve -
Wait for Terraform to finish provisioning your environment
-
Run the following command to get a list of all servers and their IPs
terraform show -json | jq -r '.values.root_module.resources[] | .name + " : " + .values.access_ip_v4'
You can use the output from the above function and apply it to the inventories/hosts file.
-
Fill out the
inventories/hostsfile using the output from theterraformcommand (see above) -
Install some collections / roles
ansible-galaxy collection install -r requirements.ymlansible-galaxy role install -r requirements.yml -
Run the server configuration playbook to apply a baseline configuration and update / reboot them
ansible-playbook site.yml -vv -b --ask-vault-pass