From 15bc12b7f652603b1c16fe906f56cde018d01a15 Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Mon, 3 May 2021 22:43:36 -0400 Subject: [PATCH] Remove ownerReferences based on secret name from backup --- roles/restore/tasks/cleanup.yml | 8 ++++---- roles/restore/tasks/deploy_awx.yml | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/restore/tasks/cleanup.yml b/roles/restore/tasks/cleanup.yml index 94a545be..0f3d7208 100644 --- a/roles/restore/tasks/cleanup.yml +++ b/roles/restore/tasks/cleanup.yml @@ -18,7 +18,7 @@ namespace: '{{ meta.namespace }}' ownerReferences: null loop: - - '{{ deployment_name }}-admin-password' - - '{{ deployment_name }}-secret-key' - - '{{ deployment_name }}-postgres-configuration' - - '{{ deployment_name }}-broadcast-websocket' + - '{{ secret_key_secret_name }}' + - '{{ admin_password_secret_name }}' + - '{{ broadcast_websocket_secret_name }}' + - '{{ postgres_configuration_secret_name }}' diff --git a/roles/restore/tasks/deploy_awx.yml b/roles/restore/tasks/deploy_awx.yml index 5ff99dee..7adfc5cc 100644 --- a/roles/restore/tasks/deploy_awx.yml +++ b/roles/restore/tasks/deploy_awx.yml @@ -16,8 +16,10 @@ - name: Write spec vars to temp file shell: | echo '{{ awx_object.stdout }} > {{ tmp_spec.path }}' + changed_when: false -- include_vars: "{{ tmp_spec.path }}" +- name: Include spec vars to save them as a dict + include_vars: "{{ tmp_spec.path }}" register: spec - name: Use include_vars to read in spec as a dict (because spec doesn't have quotes)