summaryrefslogtreecommitdiffstats
path: root/installer/roles/local_docker/tasks/compose.yml
blob: 0ab8955ceca804646697ac74e65f498c219d53b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: Create {{ docker_compose_dir }} directory
  file:
    path: "{{ docker_compose_dir }}"
    state: directory

- name: Create Docker Compose Configuration
  template:
    src: "{{ item }}.j2"
    dest: "{{ docker_compose_dir }}/{{ item }}"
    mode: 0600
  with_items:
    - environment.sh
    - credentials.py
    - docker-compose.yml
  register: awx_compose_config

- name: Render SECRET_KEY file
  copy:
    content: "{{ secret_key }}"
    dest: "{{ docker_compose_dir }}/SECRET_KEY"
    mode: 0600

- name: Start the containers
  docker_service:
    project_src: "{{ docker_compose_dir }}"
  register: awx_compose_start

- name: Update CA trust in awx_web container
  command: docker exec awx_web '/usr/bin/update-ca-trust'
  when: awx_compose_config.changed or awx_compose_start.changed

- name: Update CA trust in awx_task container
  command: docker exec awx_task '/usr/bin/update-ca-trust'
  when: awx_compose_config.changed or awx_compose_start.changed