Optimizations
This commit is contained in:
@ -41,6 +41,12 @@
|
||||
client_ips: "{{ ip_addresses | list | flatten }}"
|
||||
namehost: "{{ server_hostname }}"
|
||||
|
||||
- name: Import rear_vars role
|
||||
ansible.builtin.import_role:
|
||||
name: rhc.rear.rear_vars
|
||||
|
||||
- name: Include NFS export role
|
||||
ansible.builtin.include_role:
|
||||
name: ../roles/nfs_export
|
||||
name: rhc.rear.nfs_export
|
||||
vars:
|
||||
rear_backup_workflow: standalone
|
||||
|
@ -5,21 +5,16 @@
|
||||
gather_facts: true
|
||||
strategy: free
|
||||
|
||||
vars:
|
||||
standalone_backup_success_path: "/var/IPE/IPU/el7to8"
|
||||
standalone_backup_success_file: "{{ standalone_backup_success_path }}/standalone_rear_success"
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Check for previous backup completion
|
||||
ansible.builtin.stat:
|
||||
path: "{{ standalone_backup_success_file }}"
|
||||
register: standalone_backup_success
|
||||
path: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
|
||||
register: rear_backup_success_file
|
||||
|
||||
- name: End if backup has already completed successfully
|
||||
ansible.builtin.meta: end_host
|
||||
when:
|
||||
- standalone_backup_success['stat']['exists'] | bool
|
||||
- rear_backup_success_file['stat']['exists'] | bool
|
||||
- not rear_force_backup | default(false) | bool
|
||||
|
||||
- name: Perform ReaR Backup and write success log
|
||||
@ -30,6 +25,8 @@
|
||||
- name: Include the backup role
|
||||
ansible.builtin.include_role:
|
||||
name: rhc.rear.rear_backup
|
||||
vars:
|
||||
rear_backup_workflow: standalone
|
||||
|
||||
- name: Confirm ReaR backup log is present
|
||||
ansible.builtin.stat:
|
||||
@ -55,12 +52,12 @@
|
||||
|
||||
- name: Create success file directory if not present
|
||||
ansible.builtin.file:
|
||||
path: "{{ standalone_backup_success_path }}"
|
||||
path: "{{ rear_backup_success_file_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Create backup success file
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ standalone_backup_success_file }}"
|
||||
dest: "{{ rear_backup_success_file_path }}/{{ rear_backup_workflow }}_rear_success"
|
||||
content: "success\n"
|
||||
mode: "0644"
|
||||
|
Reference in New Issue
Block a user