Files
awx-operator/roles/restore/tasks/cleanup.yml
Christian M. Adams bfec61ad8d Dynamically collect secrets for backup & restore roles
- 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
2021-06-15 14:17:02 -04:00

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