From 94c5c41a24f0f263ae7e72548e43a4a6c849e9c3 Mon Sep 17 00:00:00 2001 From: gamuniz Date: Fri, 1 Apr 2022 14:55:57 -0400 Subject: [PATCH] reording the django tasks to avoid race condition aap-2847 (#855) * Reorder the django init tasks to avoid race condition - aap-2847 --- roles/installer/tasks/initialize_django.yml | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/installer/tasks/initialize_django.yml b/roles/installer/tasks/initialize_django.yml index 2de9ffa0..15e8575c 100644 --- a/roles/installer/tasks/initialize_django.yml +++ b/roles/installer/tasks/initialize_django.yml @@ -37,17 +37,6 @@ no_log: true when: users_result.return_code > 0 -- name: Create preload data if necessary. # noqa 305 - k8s_exec: - namespace: "{{ ansible_operator_meta.namespace }}" - pod: "{{ tower_pod_name }}" - container: "{{ ansible_operator_meta.name }}-task" - command: >- - bash -c "awx-manage create_preload_data" - register: cdo - changed_when: "'added' in cdo.stdout" - when: create_preload_data | bool - - name: Check if legacy queue is present k8s_exec: namespace: "{{ ansible_operator_meta.namespace }}" @@ -118,3 +107,14 @@ changed_when: "'changed: True' in ree.stdout" no_log: true when: _execution_environments_pull_credentials['resources'] | default([]) | length + +- name: Create preload data if necessary. # noqa 305 + k8s_exec: + namespace: "{{ ansible_operator_meta.namespace }}" + pod: "{{ tower_pod_name }}" + container: "{{ ansible_operator_meta.name }}-task" + command: >- + bash -c "awx-manage create_preload_data" + register: cdo + changed_when: "'added' in cdo.stdout" + when: create_preload_data | bool