{{announcement.body}}
{{announcement.title}}

Install Ansible on Ubuntu 18.04 With AWX

DZone 's Guide to

Install Ansible on Ubuntu 18.04 With AWX

Want to get Ansible set up on Ubuntu for your configuration management? Let's see how to install it using the AWX web-based interface.

· Open Source Zone ·
Free Resource

In this post, we will install Ansible on Ubuntu 18.04 with the AWX web-based interface for Ansible. Ansible is a top config management solution.

Ansible is the leading configuration management solution according to StackShare.

It provides agentless system management and configuration that is simple to use, easy to learn, flexible and powerful.

We will install Ansible on its own server and we will also install AWX which is a web-based interface to Ansible.

Getting Started

To begin, we need a fresh install of Ubuntu Server 18.04.1.

Next, perform all the updates and reboot.

apt update && apt upgrade -y
reboot


Next, we need to enable the universe repositories.

Open /etc/apt/sources.list and add the ‘universe’ to the end of all the lines.

deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe


Save and exit.

Update apt.

apt update


We are now ready to install Ansible.

Install Ansible

On Ubuntu, we install Ansible from a PPA.

Run the following commands to install Ansible

apt-add-repository --yes --update ppa:ansible/ansible


Finally, install Ansible.

apt install ansible -y


Now that Ansible is installed, we need to install and configure AWX the web-based interface for Ansible.

Install AWX

First, we need to install a few prerequisite packages.

Install Docker:

apt install docker.io


Install PIP and the Python Docker SDK.

apt install python-pip -y
pip install docker


Next, we need to install Node and NPM.

apt install nodejs npm -y


We need to use NPM to update itself because the version that is installed is too old for AWX.

npm install npm --global


We can now install AWX.

First, clone the git repository.

git clone https://github.com/ansible/awx.git


Next, run the installer.

cd awx/installer
ansible-playbook -i inventory install.yml


After a few minutes, ansible will finish installing AWX.

This created several docker containers on the local host.

There are many more options you can use to deploy AWX. For reference, check out the AWX install documentation on GitHub.

Once ansible is complete the AWX container will take a couple of minutes before it is ready.

You can access AWX at the following URL

http://{your_server}


You should see that AWX is upgrading.

When it is completed you will see the login screen.

Login with the default username of ‘admin’ and password of ‘password’.

We now have Ansible installed with AWX.

More Ansible

If you would like to know more check out the Continuous Delivery Using Docker and Ansible course at Pluralsight. They have a free 10-day trial so get started today.

Topics:
open source ,ansible ,ubuntu 18.04 ,awx ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}