Automating system configuration with Ansible AWX

Playbook Pal

Reluctant Restart

The Docker daemon running in the background assumes the task of managing the containers. When installing AWX, Ansible set up the daemon so that it automatically boots the AWX containers when it starts. AWX is therefore available immediately after a restart of the computer – you only have to make sure that the Docker daemon starts when booting the system. Under Ubuntu, you can ensure the Docker daemon starts with:

sudo systemctl enable docker

Alternatively, start the daemon manually with sudo systemctl start docker.

In certain circumstances, the awx_task container will perform some tasks after a restart. During this time, you will only see an AWX is Upgrading message in the browser instead of the login screen. You can monitor the progress with:

sudo docker logs -f awx_task

just like you would during the installation. If you delete the directory with the database, or your distribution does, awx_task will automatically recreate the AWX database. If you have stored the database below /tmp/pgdocker, as suggested by default, and your distribution automatically discards the contents of /tmp after a restart, you will end up with a freshly installed AWX after every system start. If you happen to encounter an error while installing or configuring AWX, see the box entitled "Loop Fix."

Loop Fix

When this issue went to press, AWX was still affected by a bug that, under certain circumstances, trapped AWX in an infinite loop. This problem sometimes occurred when PostgreSQL started up too slowly.

To fix the problem, first stop the containers with the following commands:

$ sudo docker stop awx_task
$ sudo docker stop awx_web
$ sudo docker stop memcached
$ sudo docker stop rabbitmq
$ sudo docker stop postgres

Use the sudo docker ps command to check that no containers are running. Then delete the /tmp/pgdocker subdirectory or the directory you specified with the database. At the command line, change back to the installer subdirectory of the AWX source code and enter:

sudo ansible-playbook -i inventory install.yml

Dashboard Overview

After logging in to the AWX user interface, you will be taken to the dashboard shown in Figure 1. AWX combines several individual actions to form jobs. The large graph in the middle shows how many of these jobs AWX executed recently. If the line unexpectedly rises or falls, a system may have started or terminated without you planning it. You can see which jobs AWX last executed in the box labeled Recently Run Jobs on the bottom right. A click in the upper-right corner on the heartbeat curve icon opens the Activity Stream .

Figure 1: The dashboard summarizes the current status in numbers and statistics.

This list shows all the individual actions performed in the past. This view is especially useful for troubleshooting. Click the icon again to return to the dashboard.

You are currently logged in as an all-powerful superuser who is allowed to tweak all the AWX bells and whistles. The first thing you will want to do is to change your password. To do so, click on the admin username in the upper right corner of the screen. Make sure that the Details button is enabled (and thus grayed). Then fill in the fields with your first and last name and your email address. Type your new password in Password and Confirm Password . In a production environment, you will also want to change your username in the Username field. (For the sake of simplicity, I will keep admin as the username for this article.) Press Save to save the changes.

On the left side of the page, you will find a gray bar with several symbols, which in turn lead to the various settings. A click on the hamburger symbol with the three dashes at the very top will fully extend the bar. Dashboard lets you return to the start page at any time.

Registering an Organization

AWX can manage the computers of several organizations or companies. To distinguish between the systems of different organizations in the user interface, you first need to tell AWX the names of the organizations. (Even if you are only managing the systems of one organization, you still have to provide an organization name.)

Click on Organizations in the main menu on the left-hand side of the page. By default AWX already knows an organization with the not totally creative name of Default . You can easily rename this default organization by clicking on the pencil icon (highlighted with the blue circle in Figure 2). Then change the name in the field and click Save . Add lets you add further organizations if required.

Figure 2: Click the blue pencil icon to rename the default organization.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus