diff --git a/awx/README.md b/awx/README.md new file mode 100644 index 0000000..2e35493 --- /dev/null +++ b/awx/README.md @@ -0,0 +1,9 @@ +awx +=== + +[AWX][1] provides a web-based user interface, REST API, and task engine built +on top of Ansible. It is the upstream project for [Tower][2], a commercial +derivative of AWX. + +[1]: https://github.com/ansible/awx +[2]: https://www.ansible.com/tower diff --git a/awx/data/etc/SECRET_KEY b/awx/data/etc/SECRET_KEY new file mode 100644 index 0000000..0b5f0c2 --- /dev/null +++ b/awx/data/etc/SECRET_KEY @@ -0,0 +1 @@ +isasekrit diff --git a/awx/data/etc/credentials.py b/awx/data/etc/credentials.py new file mode 100644 index 0000000..5f91162 --- /dev/null +++ b/awx/data/etc/credentials.py @@ -0,0 +1,29 @@ +DATABASES = { + 'default': { + 'ATOMIC_REQUESTS': True, + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': "awx", + 'USER': "awx", + 'PASSWORD': "awxpass", + 'HOST': "postgres", + 'PORT': "5432", + } +} + +BROKER_URL = 'amqp://guest:guest@rabbitmq:5672/awx' + +CHANNEL_LAYERS = { + 'default': {'BACKEND': 'asgi_amqp.AMQPChannelLayer', + 'ROUTING': 'awx.main.routing.channel_routing', + 'CONFIG': {'url': BROKER_URL}} +} + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': 'memcached:11211' + }, + 'ephemeral': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + }, +} diff --git a/awx/data/etc/environment.sh b/awx/data/etc/environment.sh new file mode 100644 index 0000000..817283d --- /dev/null +++ b/awx/data/etc/environment.sh @@ -0,0 +1,12 @@ +DATABASE_USER=awx +DATABASE_NAME=awx +DATABASE_HOST=postgres +DATABASE_PORT=5432 +DATABASE_PASSWORD=awxpass +DATABASE_ADMIN_PASSWORD=postgrespass +MEMCACHED_HOST=memcached +MEMCACHED_PORT=11211 +RABBITMQ_HOST=rabbitmq +RABBITMQ_PORT=5672 +AWX_ADMIN_USER=admin +AWX_ADMIN_PASSWORD=password diff --git a/awx/docker-compose.yml b/awx/docker-compose.yml index b813a54..8e4f4c2 100644 --- a/awx/docker-compose.yml +++ b/awx/docker-compose.yml @@ -1,34 +1,23 @@ +# +# https://github.com/ansible/awx/raw/devel/installer/roles/local_docker/templates/docker-compose.yml.j2 +# + version: '2' services: web: image: ansible/awx_web - ports: - - "8052:8052" + container_name: awx_web hostname: awxweb user: root + ports: + - "8052:8052" volumes: + - ./data/etc/SECRET_KEY:/etc/tower/SECRET_KEY + - ./data/etc/environment.sh:/etc/tower/conf.d/environment.sh + - ./data/etc/credentials.py:/etc/tower/conf.d/credentials.py - ./data/awx:/var/lib/awx/projects - environment: - http_proxy: '' - https_proxy: '' - no_proxy: '' - SECRET_KEY: awxsecret - DATABASE_NAME: awx - DATABASE_USER: awx - DATABASE_PASSWORD: awxpass - DATABASE_PORT: 5432 - DATABASE_HOST: postgres - RABBITMQ_USER: guest - RABBITMQ_PASSWORD: guest - RABBITMQ_HOST: rabbitmq - RABBITMQ_PORT: 5672 - RABBITMQ_VHOST: awx - MEMCACHED_HOST: memcached - MEMCACHED_PORT: 11211 - AWX_ADMIN_USER: admin - AWX_ADMIN_PASSWORD: password depends_on: - rabbitmq - memcached @@ -37,29 +26,14 @@ services: task: image: ansible/awx_task + container_name: awx_task hostname: awx user: root volumes: + - ./data/etc/SECRET_KEY:/etc/tower/SECRET_KEY + - ./data/etc/environment.sh:/etc/tower/conf.d/environment.sh + - ./data/etc/credentials.py:/etc/tower/conf.d/credentials.py - ./data/awx:/var/lib/awx/projects - environment: - http_proxy: '' - https_proxy: '' - no_proxy: '' - SECRET_KEY: awxsecret - DATABASE_NAME: awx - DATABASE_USER: awx - DATABASE_PASSWORD: awxpass - DATABASE_HOST: postgres - DATABASE_PORT: 5432 - RABBITMQ_USER: guest - RABBITMQ_PASSWORD: guest - RABBITMQ_HOST: rabbitmq - RABBITMQ_PORT: 5672 - RABBITMQ_VHOST: awx - MEMCACHED_HOST: memcached - MEMCACHED_PORT: 11211 - AWX_ADMIN_USER: admin - AWX_ADMIN_PASSWORD: password depends_on: - rabbitmq - memcached @@ -69,21 +43,27 @@ services: rabbitmq: image: ansible/awx_rabbitmq + container_name: awx_rabbitmq environment: RABBITMQ_DEFAULT_VHOST: awx + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest RABBITMQ_ERLANG_COOKIE: cookiemonster restart: unless-stopped memcached: image: memcached:alpine + container_name: awx_memcached restart: unless-stopped postgres: - image: postgres:9.6-alpine + image: postgres:12-alpine + container_name: awx_postgres volumes: - - ./data/postgres:/var/lib/postgresql/data + - ./data/postgres:/var/lib/postgresql/data/pgdata:Z environment: POSTGRES_USER: awx POSTGRES_PASSWORD: awxpass POSTGRES_DB: awx + PGDATA: /var/lib/postgresql/data/pgdata restart: unless-stopped