mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-06 13:22:50 +00:00
- This prevents us from overwriting vars unintentionally at restore time - This will make it easier to add secrets to be backed up in the future - Add generated secret names to awx spec backup - Fail early if secret status doesn't exist - Skip if secret is not in spec for non-generated secrets - Secret values must be b64 decoded before secret is created - Cleanup temp files
37 lines
860 B
YAML
37 lines
860 B
YAML
---
|
|
|
|
- name: Delete any existing management pod
|
|
k8s:
|
|
name: "{{ meta.name }}-db-management"
|
|
kind: Pod
|
|
namespace: "{{ backup_pvc_namespace }}"
|
|
state: absent
|
|
force: true
|
|
|
|
- name: Remove ownerReferences from secrets to avoid garbage collection
|
|
k8s:
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: '{{ item }}'
|
|
namespace: '{{ meta.namespace }}'
|
|
ownerReferences: null
|
|
loop:
|
|
- '{{ secret_key_secret }}'
|
|
- '{{ admin_password_secret }}'
|
|
- '{{ broadcast_websocket_secret }}'
|
|
- '{{ postgres_configuration_secret }}'
|
|
|
|
- name: Cleanup temp spec file
|
|
file:
|
|
path: "{{ tmp_spec.path }}"
|
|
state: absent
|
|
when: tmp_spec.path is defined
|
|
|
|
- name: Cleanup temp secret vars file
|
|
file:
|
|
path: "{{ secret_vars.path }}"
|
|
state: absent
|
|
when: secret_vars.path is defined
|