mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-08 22:33:35 +00:00
init backup CR files
This commit is contained in:
81
roles/backup/README.md
Normal file
81
roles/backup/README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
Role Name
|
||||
=========
|
||||
|
||||
The purpose of this role is to create a backup of your AWX deployment. This includes:
|
||||
- backup of the postgresql database
|
||||
- secret_key
|
||||
- custom user config files
|
||||
- manual projects
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
This role assumes you are authenticated with an Openshift or Kubernetes cluster which:
|
||||
- The awx-operator has been deployed to
|
||||
- AWX is deployed to via the operator
|
||||
|
||||
|
||||
Usage
|
||||
----------------
|
||||
|
||||
Then create a file named `backup-awx.yml` with the following contents:
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: awx.ansible.com/v1beta1
|
||||
kind: Backup
|
||||
metadata:
|
||||
name: awx
|
||||
namespace: my-namespace
|
||||
```
|
||||
|
||||
Finally, use `kubectl` to create the awx instance in your cluster:
|
||||
|
||||
```bash
|
||||
#> kubectl apply -f backup-awx.yml
|
||||
```
|
||||
|
||||
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
A custom, pre-created pvc can be used by setting the following variables.
|
||||
|
||||
```
|
||||
tower_backup_pvc: 'awx-backup-volume-claim'
|
||||
```
|
||||
|
||||
This role will automatically create a pvc using a Storage Class if provided:
|
||||
|
||||
```
|
||||
tower_postgres_storage_class: 'standard'
|
||||
tower_backup_size: '20Gi'
|
||||
```
|
||||
|
||||
If a custom postgres configuration secret was used when deploying AWX, it must be set:
|
||||
|
||||
```
|
||||
tower_postgres_configuration_secret: 'awx-postgres-configuration'
|
||||
```
|
||||
|
||||
|
||||
Testing
|
||||
----------------
|
||||
|
||||
You can test this role directly by creating and running the following playbook with the appropriate variables:
|
||||
|
||||
```
|
||||
---
|
||||
- name: Backup Tower
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
roles:
|
||||
- backup
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
MIT
|
||||
@@ -1,18 +1,3 @@
|
||||
---
|
||||
deployment_type: "{{ meta.name | default('awx', true)}}"
|
||||
|
||||
# Secret to lookup that provide the secret key
|
||||
#
|
||||
tower_secret_key_secret: ''
|
||||
|
||||
tower_postgres_storage_class: ''
|
||||
tower_postgres_data_path: '/var/lib/postgresql/data/pgdata'
|
||||
|
||||
# Secret to lookup that provide the PostgreSQL configuration
|
||||
#
|
||||
tower_postgres_configuration_secret: ''
|
||||
tower_old_postgres_configuration_secret: ''
|
||||
|
||||
tower_postgres_image: postgres:12
|
||||
tower_backup_pvc: ''
|
||||
tower_backup_size: ''
|
||||
|
||||
30
roles/backup/meta/main.yml
Normal file
30
roles/backup/meta/main.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: Ansible
|
||||
description: AWX role for AWX Operator for Kubernetes.
|
||||
company: Red Hat, Inc.
|
||||
|
||||
license: MIT
|
||||
|
||||
min_ansible_version: 2.8
|
||||
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
|
||||
galaxy_tags:
|
||||
- tower
|
||||
- awx
|
||||
- ansible
|
||||
- backup
|
||||
- automation
|
||||
|
||||
dependencies: []
|
||||
|
||||
collections:
|
||||
- community.kubernetes
|
||||
- operator_sdk.util
|
||||
@@ -7,7 +7,7 @@ metadata:
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: standard
|
||||
storageClassName: {{ tower_postgres_storage_class }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ tower_backup_size | default('5Gi', true) }}
|
||||
|
||||
13
roles/backup/vars/main.yml
Normal file
13
roles/backup/vars/main.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
|
||||
# Specify a pre-created PVC (name) to backup to
|
||||
tower_backup_pvc: ''
|
||||
|
||||
# Size of backup PVC if created dynamically
|
||||
tower_backup_size: ''
|
||||
|
||||
# Specify storage class to determine how to dynamically create PVC's with
|
||||
tower_postgres_storage_class: ''
|
||||
|
||||
# Secret to lookup that provide the PostgreSQL configuration
|
||||
tower_postgres_configuration_secret: ''
|
||||
Reference in New Issue
Block a user