Add stuffs
This commit is contained in:
parent
b8ecbc7876
commit
a3e931188f
@ -24,7 +24,7 @@
|
|||||||
- name: Update NFS exports on reachable servers
|
- name: Update NFS exports on reachable servers
|
||||||
hosts: reachable_hosts
|
hosts: reachable_hosts
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Grab the template name
|
- name: Grab the template name
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure share directory exists
|
- name: Ensure share directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ share }}"
|
path: "{{ rear_nfs_export_share }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0777"
|
mode: "0777"
|
||||||
owner: root
|
owner: root
|
||||||
group: 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
|
- name: Check disk space on ReaR Backup filesystem for NFS servers
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -o pipefail
|
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
|
register: disk_space
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
@ -33,7 +38,7 @@
|
|||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/exports
|
path: /etc/exports
|
||||||
state: present
|
state: present
|
||||||
line: "{{ share }} {{ _options }}"
|
line: "{{ rear_nfs_export_share }} {{ _options }}"
|
||||||
loop: "{{ client_ips | list | flatten }}"
|
loop: "{{ client_ips | list | flatten }}"
|
||||||
vars:
|
vars:
|
||||||
_options: "{{ item }}(fsid=0,rw,sync,no_subtree_check,crossmnt)"
|
_options: "{{ item }}(fsid=0,rw,sync,no_subtree_check,crossmnt)"
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
share: "/backups/standalone"
|
rear_nfs_export_share: "/backups/standalone"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user