Get started using Ansible AWX (Open Source Tower version) in one minute

Since yesterday's announcement that Ansible had released the code behind Ansible Tower, AWX, under an open source license, I've been working on an AWX Ansible role, a demo AWX Vagrant VM, and an AWX Ansible Container project.

As part of that last project, I have published two public Docker Hub images, awx_web and awx_task, which can be used with a docker-compose.yml file to build AWX locally in about as much time as it takes to download the Docker images:

curl -O https://raw.githubusercontent.com/geerlingguy/awx-container/master/docker-compose.yml
docker-compose up -d

After docker-compose is finished, wait a couple minutes for the initial database migration to run, then you should be able to access AWX at http://localhost/ (the default login is admin/password):

Ansible AWX Dashboard - after initialization - with Angry Potato

You can find out all the details as to how this works, and how you can build the Docker images yourself using Ansible Container in the project repository: AWX (Built with Ansible Container).

Comments

Trying your images but it seems to fail and on the PostgreSQL docker console all i see is the following repeated (MACOS laptop runnign stable docker) )

ERROR:  relation "conf_setting" does not exist at character 158
STATEMENT:  SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."user_id" IS NULL AND
...
"main_schedule"."next_run" DESC

@Nick - Usually this just means the initial database migration hasn't completed yet. It takes 5-10 minutes after setup is complete, and until that time, if you access the home page, you'll see a 500 error and signin attempts will fail.

Check the logs of the awx_task container instead, and see if it's still running the migration.

Where does this angry potato come from?

That... I'm still not entirely sure of. Though the AWX team at Ansible has a few nicknames already in the running:

Trying your images but it just show "CANCEL OK × OK working... "

docker logs awx_task_1 showed that the initialization process seems completed

Applying social_auth.0003_alter_email_max_length... OK
Applying social_auth.0004_auto_20160423_0400... OK
Applying social_auth.0005_auto_20160727_2333... OK
Applying sso.0001_initial... OK
Applying sso.0002_expand_provider_options... OK
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

>>>
>>> Default organization added.
Demo Credential, Inventory, and Job Template added.
Successfully registered instance awx
(changed: True)
Creating instance group tower
Added instance awx to tower
(changed: True)
2017-09-11 04:13:55,336 CRIT Supervisor running as root (no user in config file)
2017-09-11 04:13:55,336 WARN For [program:awx-celeryd-beat], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
2017-09-11 04:13:55,342 INFO RPC interface 'supervisor' initialized
2017-09-11 04:13:55,342 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-09-11 04:13:55,342 INFO supervisord started with pid 90
2017-09-11 04:13:56,345 INFO spawned: 'celery' with pid 93
2017-09-11 04:13:56,346 INFO spawned: 'channels-worker' with pid 94
2017-09-11 04:13:56,347 INFO spawned: 'callback-receiver' with pid 95
2017-09-11 04:13:56,348 INFO spawned: 'awx-celeryd-beat' with pid 96
2017-09-11 04:13:57,351 INFO success: celery entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-11 04:13:57,351 INFO success: channels-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-11 04:13:57,351 INFO success: callback-receiver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-11 04:13:57,351 INFO success: awx-celeryd-beat entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
^C

You probably need to wait a bit longer for all the migrations to finish. Also, try opening a different browser after the 5-10 minute period (you'll know when your CPU goes down to idle again). Sometimes the browser caches that weird unformatted page and doesn't seem to be able to pick up the actual rendered page once the web container actually starts working correctly.

Another option that also works is to docker-compose stop and then start (again, after the initial database migration is complete).

Hmm, I'm having the same issue now and my CPU usage has gone down. Getting 404s on all the CSS and JS files. Tried it a few times now. Other suggestions?

In the image itself, nginx.conf is pointing to /var/lib/awx/public/static/ for static,
but all of the content is at /usr/lib/python2.7/site-packages/awx/ui/static/

Hello Jeff,

Very good documented. I used this URL https://github.com/geerlingguy/awx-container to build all the container. When I try to run the sudo -E ansible-playbook -i 'localhost,' -c local prebuild.yml I'm getting the following error.

TASK [Build base web image] **********************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error building awx_web - code: None, message: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers), logs: [u'Step 1/32 : FROM centos:7\\n']"}
to retry, use: --limit @/git/awx-container/prebuild/prebuild.retry

The server is behind a Proxy.
Can you please advise?

I'm able to resolve my issue.

Jeff, I used docker-compose to install awx, I have two problems. First it seems stuck at "AWX is upgrading or install" and second, I'm only able to access via localhost using elinks. Any help would be appreciated. thanks

Jeff, I'm having a heck of a time. Two things, first I can only get to awx via localhost (http://localhost), but then I only get the message "AWX is currently upgrading or installing, this page will refresh when done" Well, it never get done. Please help.

thanks

Great work ! thanks for supplying the containers. Runs fine but a bit slow.

Is it possible to speed things up ?

thanks

Is there any yaml file(s) for kubernetes deployment from you.

Or, if you can give me an idea on disabling the login page. That would be helpful.
I tried to disable by adding property
AUTH_BASIC_ENABLED = False
at /etc/tower/settings.py in both awx_task/awx_web pods but no use.

Hey Jeff,

I found this tutorial interesting. What I haven't quite been able to work out is how to bring up an AWX installation without using containers or openshift. I have put together a small cluster with vagrant and installed ansible. Can you tell me what rpm needs to be installed for the GUI or what source to compile? Thanks

Dear Jeff, thank you very much for the job. This is amazing, I need only one docker-compose file and voilà: PostgreSQL, Rabit, Elasticsearch and AWX have found their living on my workstation. Yet your images `geerlingguy/awx_task` and `geerlingguy/awx_web` have never started there, so I've forever got AWX is upgrading. I waited for an hour and the migration didn't complete. I'm sorry.

I've changed the docker-compose.yml file placed the 'official' (I'm aware AWX has no official builds since the software isn't supported by RedHat) images there: `ansible/awx_web:latest` and `ansible/awx_web:latest`. It took nearly 15 minutes to migrate the database and now I'm able to login to AWX.

Nevertheless, as I noted at the beginning, thank you so much for your work, without this composer file I must have installed the required database and middleware step by step and wasted a lot of time.

Hey Jeff Geerling,
Thank you for this wonderful documentation.
I was able to launch this AWX tower, But i need to understand about the logs, where will i find the logs for this AWX tower
and how will i find the status of this AWX tower?
i have installed this using root user?
Do i need to install this with seperate user?
please help me sir

This is coming pretty late, so I assume you already have found an answer to your question, but for anyone else that finds their way here, this setup uses Docker containers to run AWX. If you aren't familiar with Docker, it is kind of a virtualization, or self contained images run on the parent OS. You probably don't need an in depth knowledge of Docker to get this to run, but it certainly helps to troubleshoot.

To look at the logs, you first need to find your containers. As root (or any user that is part of the docker group), you can run 'docker ps' to see your running containers. To look at the logs of a particular container as if you are tailing a log file, you need to do "docker logs -f ." That should get you started. Anything more in depth is really outside the scope of a comment section.