Allow for platform specific variables in docker-compose install

This changes the default docker_compose_dir on macos to a writeable location
This commit is contained in:
Shane McDonald 2019-03-27 09:32:04 -04:00
parent a6d031f46f
commit c44bf6f903
5 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,6 @@
---
- name: Build and deploy AWX
hosts: all
gather_facts: false
roles:
- { role: check_vars }
- { role: image_build, when: "dockerhub_base is not defined" }

View File

@ -12,4 +12,3 @@ rabbitmq_default_password: "guest"
postgresql_version: "9.6"
postgresql_image: "postgres:{{postgresql_version}}"
docker_compose_dir: "/var/lib/awx"

View File

@ -1,4 +1,13 @@
---
- include_vars: '{{ item }}'
with_first_found:
- files:
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml' # CentOS-7
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml' # RedHat-7
- '{{ ansible_distribution }}.yml' # CentOS
- '{{ ansible_os_family }}.yml' # RedHat
- 'default.yml'
- name: Create {{ docker_compose_dir }} directory
file:
path: "{{ docker_compose_dir }}"
@ -33,7 +42,7 @@
docker_service:
project_src: "{{ docker_compose_dir }}"
register: awx_compose_start
- name: Update CA trust in awx_web container
command: docker exec awx_web_1 '/usr/bin/update-ca-trust'
when: awx_compose_config.changed or awx_compose_start.changed

View File

@ -0,0 +1 @@
docker_compose_dir: "/usr/local/var/lib/awx"

View File

@ -0,0 +1 @@
docker_compose_dir: "/var/lib/awx"