Run migrations via a task, not in the container

* Issue: https://github.com/ansible/awx/issues/9077
  * Fixes problem with migrations not completing
This commit is contained in:
Christian M. Adams
2021-01-13 15:44:05 -05:00
parent 57c3b9ab17
commit 88a0d98447
2 changed files with 11 additions and 0 deletions

View File

@@ -36,6 +36,11 @@
register: awx_secret_key register: awx_secret_key
- block: - block:
- name: Run migrations in task container
shell: docker-compose run --rm --service-ports task awx-manage migrate --no-input
args:
chdir: "{{ docker_compose_dir }}"
- name: Start the containers - name: Start the containers
docker_compose: docker_compose:
project_src: "{{ docker_compose_dir }}" project_src: "{{ docker_compose_dir }}"
@@ -50,6 +55,11 @@
command: docker exec awx_task '/usr/bin/update-ca-trust' command: docker exec awx_task '/usr/bin/update-ca-trust'
when: awx_compose_config.changed or awx_compose_start.changed when: awx_compose_config.changed or awx_compose_start.changed
- name: Wait for launch script to create user
wait_for:
timeout: 10
delegate_to: localhost
- name: Create Preload data - name: Create Preload data
command: docker exec awx_task bash -c "/usr/bin/awx-manage create_preload_data" command: docker exec awx_task bash -c "/usr/bin/awx-manage create_preload_data"
when: create_preload_data|bool when: create_preload_data|bool

View File

@@ -149,6 +149,7 @@ services:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
environment: environment:
AWX_SKIP_MIGRATIONS: "1"
http_proxy: {{ http_proxy | default('') }} http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }} https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }} no_proxy: {{ no_proxy | default('') }}