AWX/ Ansible Server Requirements:
- Supported Operating Systems: CentOS 8 64-bit to be running Openshift, Docker or Kubernetes (I used Docker)
- Memory: 2 GB RAM minimum (4+ GB RAM recommended)
- CPU: 3.4 GHz with 2 Cores
- HDD: 20 GB
- 64-bit support required (kernel and runtime)
- Latest stable release of Ansible
- Install EPEL on CentOS 8dnf install epel-release -y
- Install additional packages and dependenciesdnf install git gcc gcc-c++ nodejs gettext device-mapper-persistent-data lvm2 bzip2 python3-pip
- Install Docker CE on CentOS 8dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repodnf install docker-ce-3:18.09.1-3.el7
- To know what exact version of docker we have installedrpm -qa | grep dockerordocker --version
- To start and enable dockersystemctl start dockersystemctl enable --now docker.service
- To set python command to use python 3 because in CentOS 8 and RHEL8, python 3 is installed as dependency when we install ansiblealternatives --set python /usr/bin/python3
- Install Docker-Compose on CentOS 8pip3 install docker-compose
- Install Ansible AWXgit clone https://github.com/ansible/awx.git
- Adjust few following parametersNavigate to the awx/installer directory and locate the inventory file.cd awx/installer/vi inventoryNeed to configure the Admin & Postgres passwordpg_admin_password=postgrespass@123admin_password=Linuxtechi@123To generate a cryptographic key for encryption of the inventory fileopenssl rand -base64 30To confirm and print out the changes made, run the commandgrep -v '^#' inventory | grep -v '^$'
- To install AWX run the Ansible commandansible-playbook -i inventory install.yml
- After the installation is done, check the containers which are launched via docker-composedocker ps
- Allow the http port (80) and https (443)firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --add-service=httpsfirewall-cmd --reload
- Access AWX GUI Portal
- Login to Ansible Tower / AWX with admin privileges.
Admin
Password
Login Console |
- Add/ Create new credentials:
Navigate to credentials tab. Click on “+” to create new credentials.
Credentials Page |
- Enter the credential name, description, organization and search for credential type.
- From the list, select “Machine” to add username and password as credentials.
- Enter the username and password to store the credential.
Create Project:
Once you clicked ‘+’ symbol, provide the following values:
Name: “project name”
and select the “organization” “here its default”
and select “SCM Type “ “here its Manual, since I have .yaml files on local machine” else select “Git”.
“Project base path”: The default project path on local machine is “/var/lib/awx/projects”, the .yaml files should be kept here on AWX server. Then only the playbook directory will list under “Playbook Directory” comb box, else NO.
Once the values are given click “save” to create project.
Create Inventory:
Select “Inventories” from the menu and click the ‘+’ symbol to create new inventory.
Once you clicked ‘+’ symbol, provide the following values:
Name: inventory name
Name: template name
Job type: Check/ Run/ Scan – here “run”
Inventory: select already created inventory
Project: select already created project
Playbook: The combo box lists the playbooks under the selected project, select the one you want to run at this time
Credentials: select already created credentials
Verbosity: it can be default, else select as per the your verbose requirement
Launch the playbook:
Click the “Jet” button from templates to launch/ run the playbook under that template.
0 Comments