Rename Backup CR to AWXBackup to be more unique

- we could alternatively direct users to use the full GVK.  Issue is potential conflict with AH operator CRs
This commit is contained in:
Christian M. Adams
2021-03-26 16:40:36 -04:00
parent 91dda5cb16
commit 4839bdcaad
5 changed files with 29 additions and 23 deletions

View File

@@ -1,14 +1,14 @@
apiVersion: apiextensions.k8s.io/v1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
name: backups.awx.ansible.com name: awxbackups.awx.ansible.com
spec: spec:
group: awx.ansible.com group: awx.ansible.com
names: names:
kind: Backup kind: AWXBackup
listKind: BackupList listKind: AWXBackupList
plural: backups plural: awxbackups
singular: backup singular: awxbackup
scope: Namespaced scope: Namespaced
versions: versions:
- name: v1beta1 - name: v1beta1

View File

@@ -1,7 +1,7 @@
apiVersion: awx.ansible.com/v1beta1 apiVersion: awx.ansible.com/v1beta1
kind: Backup kind: AWXBackup
metadata: metadata:
name: example-awx name: example-awxbackup
namespace: example-awx namespace: example-awx
spec: spec:
tower_backup_pvc: '' tower_backup_pvc: ''

View File

@@ -24,9 +24,9 @@ Then create a file named `backup-awx.yml` with the following contents:
```yaml ```yaml
--- ---
apiVersion: awx.ansible.com/v1beta1 apiVersion: awx.ansible.com/v1beta1
kind: Backup kind: AWXBackup
metadata: metadata:
name: awx name: awxbackup
namespace: my-namespace namespace: my-namespace
``` ```

View File

@@ -1,15 +1,26 @@
--- ---
- include_tasks: init.yml - name: Look up details for this deployment
k8s_info:
api_version: 'v1beta1' # TODO: How to parameterize this?
kind: "AWX" # TODO: How to parameterize this?
name: "{{ meta.name }}"
namespace: "{{ meta.namespace }}"
register: this_awx
- include_tasks: postgres.yml - block:
- include_tasks: init.yml
- include_tasks: secrets.yml - include_tasks: postgres.yml
# TODO: Add task to change the status on the backup CR when this runs successfully - include_tasks: secrets.yml
- name: Set flag signifying this backup was successful
set_fact:
tower_backup_complete: "{{ _backup_dir }}"
# TODO: Add task to change the status on the backup CR when this runs successfully
- name: Set flag signifying this backup was successful
set_fact:
tower_backup_complete: "{{ _backup_dir }}"
- include_tasks: cleanup.yml - include_tasks: cleanup.yml
when:
- this_awx['resources'][0]['status']['towerMigratedFromSecret'] is not defined

View File

@@ -7,13 +7,8 @@
name: finalizer.awx.ansible.com name: finalizer.awx.ansible.com
role: finalizer role: finalizer
# - version: v1beta1
# group: awx.ansible.com
# kind: Backup
# role: /opt/ansible/roles/backup
# reconcilePeriod: 360m
- version: v1beta1 - version: v1beta1
group: awx.ansible.com group: awx.ansible.com
kind: Backup kind: Backup
role: backup role: backup
reconcilePeriod: 360m