This commit is contained in:
2025-03-05 16:44:31 -05:00
parent 8c4ce22fe0
commit 0360927617
5 changed files with 31 additions and 41 deletions

View File

@ -1,27 +1,27 @@
---
- name: Ensure share directory exists
ansible.builtin.file:
path: "{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }}"
path: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}"
state: directory
mode: "0777"
owner: root
group: root
# We should use Ansible to determine disk space, not command/shell:
- name: Debug mounts
ansible.builtin.debug:
var: ansible_facts['mounts']
# - name: Debug mounts
# ansible.builtin.debug:
# var: ansible_facts['mounts']
- name: Check disk space on ReaR Backup filesystem for NFS servers
ansible.builtin.shell: |
set -o pipefail
df -BG {{ rear_vars_nfs_share[rear_backup_workflow]['share'] }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
df -BG {{ rear_vars_nfs_base }}/{{ rear_backup_workflow }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
register: disk_space
changed_when: false
- name: Debug disk_space
ansible.builtin.debug:
var: disk_space
# - name: Debug disk_space
# ansible.builtin.debug:
# var: disk_space
- name: Fail job if less than 50GB space
ansible.builtin.fail:
@ -38,12 +38,12 @@
ansible.builtin.lineinfile:
path: /etc/exports
state: present
line: "{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }} {{ _options }}"
line: "{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }} {{ _options }}"
create: true
mode: "0644"
owner: root
group: root
loop: "{{ client_ips | list | flatten }}"
vars:
_options: "{{ item }}(fsid={{ rear_vars_nfs_share[rear_backup_workflow]['fsid'] }},rw,sync,no_subtree_check,crossmnt)"
_options: "{{ item }}(fsid={{ rear_vars_nfs_fsid[rear_backup_workflow] }},rw,sync,no_subtree_check,crossmnt)"
notify: Export share

View File

@ -3,9 +3,9 @@
##############################################
OUTPUT=ISO
OUTPUT_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }}
OUTPUT_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}
BACKUP=NETFS
BACKUP_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }}
BACKUP_URL=nfs://{{ nfs_srv }}{{ rear_vars_nfs_base }}/{{ rear_backup_workflow }}
# SSH_ROOT_PASSWORD="bob"
USE_STATIC_NETWORKING=yes
CLONES_ALL_USERS_GROUPS=yes

View File

@ -14,35 +14,25 @@ rear_restore_tmpdir: /tmp/rear_restore
# - rear_backup
rear_backup_success_file_path: "/var/IPE/IPU/el7to8"
rear_vars_grub_label: 'Relax-and-Recover *** RESTORES RHEL7 ***'
rear_vars_grub_conf: /etc/grub.d/45_rear
# Used by:
# - nfs_export
# - nfs_server_define
# - rear_backup
# - rear_local-cfg
# - rear_local_cfg
rear_vars_nfs_base: /backups
rear_vars_nfs_share:
standalone:
share: "{{ rear_vars_nfs_base }}/standalone"
fsid: 10
bigboot:
share: "{{ rear_vars_nfs_base }}/bigboot"
fsid: 20
rhel-os-upgrade:
share: "{{ rear_vars_nfs_base }}/rhel-os-upgrade"
fsid: 30
rear_vars_nfs_fsid:
standalone: 10
bigboot: 20
rhel-os-upgrade: 30
# Used by:
# - rear_local-cfg
# - nfs_server_define
rear_vars_nfs_np:
- 10.10.42.180
- 10.10.42.228
rear_vars_nfs_prod:
- 10.10.42.180
# Used by:
# - rear_backup
rear_vars_grub_label: 'Relax-and-Recover *** RESTORES RHEL7 ***'
rear_vars_grub_conf: /etc/grub.d/45_rear