Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
---
nfs_ports: [111,2049,20048]
nfs_src_ip: [0.0.0.0/0]
nfs_exports: []
# - path: /data
# access:
# - '-rw,sync,nohide,insecure,no_root_squash,no_subtree_check'
# - mbox.domain.tld(rw,async)

View File

@@ -0,0 +1,4 @@
---
- name: reload nfs
service: name=nfs-server state=reloaded

View File

@@ -0,0 +1,28 @@
---
- name: Install packages
yum: name=nfs-utils
tags: nfs
- name: Handle NFS ports
iptables_raw:
name: nfs_ports
state: "{{ (nfs_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp -m multiport --dports {{ nfs_ports | join(',') }} -s {{ nfs_src_ip | join(',') }} -j ACCEPT\n
-A INPUT -m state --state NEW -p udp -m multiport --dports {{ nfs_ports | join(',') }} -s {{ nfs_src_ip | join(',') }} -j ACCEPT"
when: iptables_manage | default(True)
tags: nfs,firewall
- name: Configure exports
template: src=exports.j2 dest=/etc/exports
notify: reload nfs
- name: Create the exports.d directory
file: path=/etc/exports.d state=directory
tags: nfs
- name: Start and enable services
service: name={{ item }} state=started enabled=True
with_items:
- nfs-server
tags: nfs

View File

@@ -0,0 +1,3 @@
{% for export in nfs_exports %}
{{ export.path }} {{ export.access | join(' ') }}
{% endfor %}