Begin validation code re-work
All checks were successful
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 49s
All checks were successful
Ansible Lint Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 49s
This commit is contained in:
@ -3,6 +3,7 @@ run-name: ${{ gitea.actor }} is running Ansible Code Pipeline
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- validate_backup
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
15
playbooks/rear_backup_validation.yml
Normal file
15
playbooks/rear_backup_validation.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
- name: Perform ReaR Backup Validation
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
gather_facts: true
|
||||||
|
strategy: free
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Import rear_vars role
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: rhc.rear.rear_vars
|
||||||
|
|
||||||
|
- name: Validiate ReaR backup completion
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: rhc.rear.rear_backup_validation
|
@ -16,6 +16,6 @@ collections:
|
|||||||
- name: rhc.rear
|
- name: rhc.rear
|
||||||
source: https://gitea.thezengarden.net/ansible_collections/ansible-collection-rear.git
|
source: https://gitea.thezengarden.net/ansible_collections/ansible-collection-rear.git
|
||||||
type: git
|
type: git
|
||||||
version: main
|
version: validate_backup
|
||||||
|
|
||||||
...
|
...
|
||||||
|
11
roles/rear_backup_validatation/tasks/main.yml
Normal file
11
roles/rear_backup_validatation/tasks/main.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- name: Validate ReaR backup completion
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "grep 'Finished running mkbackup workflow' /var/log/rear/rear-{{ ansible_hostname }}.log"
|
||||||
|
register: rear_backup_validate
|
||||||
|
failed_when: rear_backup_validate['rc'] not in [0]
|
||||||
|
|
||||||
|
- name: Debug rear_backup_validate
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ rear_backup_validate }}"
|
||||||
|
|
Reference in New Issue
Block a user