From 79ab6f0b5ec94ce822dfe4ab217bd52545bc5324 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:02:28 -0400 Subject: [PATCH] Fix disable reverse sync on mgmt command (#1977) --- roles/installer/tasks/initialize_django.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/roles/installer/tasks/initialize_django.yml b/roles/installer/tasks/initialize_django.yml index 3bfdd3ebd..ab2fe1c42 100644 --- a/roles/installer/tasks/initialize_django.yml +++ b/roles/installer/tasks/initialize_django.yml @@ -18,13 +18,11 @@ namespace: "{{ ansible_operator_meta.namespace }}" pod: "{{ awx_web_pod_name }}" container: "{{ ansible_operator_meta.name }}-web" - command: awx-manage createsuperuser --username={{ admin_user | quote }} --email={{ admin_email | quote }} --noinput + command: bash -c "ANSIBLE_REVERSE_RESOURCE_SYNC=false awx-manage createsuperuser --username={{ admin_user | quote }} --email={{ admin_email | quote }} --noinput" register: result changed_when: "'That username is already taken' not in result.stderr" failed_when: "'That username is already taken' not in result.stderr and 'Superuser created successfully' not in result.stdout" no_log: "{{ no_log }}" - environment: - ANSIBLE_REVERSE_RESOURCE_SYNC: "false" when: users_result.return_code > 0 - name: Update Django super user password @@ -116,9 +114,7 @@ pod: "{{ awx_web_pod_name }}" container: "{{ ansible_operator_meta.name }}-web" command: >- - bash -c "awx-manage create_preload_data" + bash -c "ANSIBLE_REVERSE_RESOURCE_SYNC=false awx-manage create_preload_data" register: cdo changed_when: "'added' in cdo.stdout" - environment: - ANSIBLE_REVERSE_RESOURCE_SYNC: "false" when: create_preload_data | bool