Optimizations

This commit is contained in:
2025-03-03 20:15:51 -05:00
parent 589da360dd
commit 0ff9e4410a
6 changed files with 26 additions and 18 deletions

View File

@ -1,7 +1,7 @@
---
- name: Ensure share directory exists
ansible.builtin.file:
path: "{{ rear_nfs_export_share }}"
path: "{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }}"
state: directory
mode: "0777"
owner: root
@ -15,7 +15,7 @@
- name: Check disk space on ReaR Backup filesystem for NFS servers
ansible.builtin.shell: |
set -o pipefail
df -BG {{ rear_nfs_export_share }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
df -BG {{ rear_vars_nfs_share[rear_backup_workflow]['share'] }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
register: disk_space
changed_when: false
@ -38,12 +38,12 @@
ansible.builtin.lineinfile:
path: /etc/exports
state: present
line: "{{ rear_nfs_export_share }} {{ _options }}"
line: "{{ rear_vars_nfs_share[rear_backup_workflow]['share'] }} {{ _options }}"
create: true
mode: "0644"
owner: root
group: root
loop: "{{ client_ips | list | flatten }}"
vars:
_options: "{{ item }}(fsid={{ rear_nfs_export_fsid }},rw,sync,no_subtree_check,crossmnt)"
_options: "{{ item }}(fsid={{ rear_vars_nfs_share[rear_backup_workflow]['fsid'] }},rw,sync,no_subtree_check,crossmnt)"
notify: Export share