Add stuffs

This commit is contained in:
2025-02-22 07:00:34 -05:00
parent b8ecbc7876
commit a3e931188f
3 changed files with 10 additions and 5 deletions

View File

@ -1,16 +1,21 @@
---
- name: Ensure share directory exists
ansible.builtin.file:
path: "{{ share }}"
path: "{{ rear_nfs_export_share }}"
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: Check disk space on ReaR Backup filesystem for NFS servers
ansible.builtin.shell: |
set -o pipefail
df -BG {{ share }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
df -BG {{ rear_nfs_export_share }} | tail -1 | awk '{print substr($4, 1, length($4)-1)}'
register: disk_space
changed_when: false
@ -33,7 +38,7 @@
ansible.builtin.lineinfile:
path: /etc/exports
state: present
line: "{{ share }} {{ _options }}"
line: "{{ rear_nfs_export_share }} {{ _options }}"
loop: "{{ client_ips | list | flatten }}"
vars:
_options: "{{ item }}(fsid=0,rw,sync,no_subtree_check,crossmnt)"