mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
---
|
|
- name: Patching labels to {{ kind }} kind
|
|
k8s:
|
|
state: present
|
|
definition:
|
|
apiVersion: '{{ api_version }}'
|
|
kind: '{{ kind }}'
|
|
name: '{{ meta.name }}'
|
|
namespace: '{{ meta.namespace }}'
|
|
metadata:
|
|
name: '{{ meta.name }}'
|
|
namespace: '{{ meta.namespace }}'
|
|
labels:
|
|
app.kubernetes.io/name: '{{ meta.name }}'
|
|
app.kubernetes.io/part-of: '{{ meta.name }}'
|
|
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
|
|
app.kubernetes.io/component: '{{ deployment_type }}'
|
|
app.kubernetes.io/operator-version: '{{ lookup("env", "OPERATOR_VERSION") }}'
|
|
|
|
- name: Look up details for this backup object
|
|
k8s_info:
|
|
api_version: "{{ api_version }}"
|
|
kind: "{{ kind }}"
|
|
name: "{{ meta.name }}"
|
|
namespace: "{{ meta.namespace }}"
|
|
register: this_backup
|
|
|
|
- block:
|
|
- include_tasks: init.yml
|
|
|
|
- include_tasks: postgres.yml
|
|
|
|
- include_tasks: secrets.yml
|
|
|
|
- include_tasks: awx-cro.yml
|
|
|
|
- name: Set flag signifying this backup was successful
|
|
set_fact:
|
|
backup_complete: true
|
|
|
|
- include_tasks: cleanup.yml
|
|
|
|
when:
|
|
- this_backup['resources'][0]['status']['backupDirectory'] is not defined
|
|
|
|
- name: Update status variables
|
|
include_tasks: update_status.yml
|
|
|
|
# TODO: backup tower settings or make sure that users only specify settings/config changes via AWX object. See ticket
|