aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/nfs/templates
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-12-17 05:38:20 +0100
committerEgor Tensin <egor@tensin.name>2024-12-17 05:48:46 +0100
commitce73aab536e5cf3b91a2305e2f292627d157892b (patch)
tree8cbce44c71f7094db4dfb724e10d8d59fa31c1bd /roles/nfs/templates
parentv4.1.0 (diff)
downloadinfra-ansible-ce73aab536e5cf3b91a2305e2f292627d157892b.tar.gz
infra-ansible-ce73aab536e5cf3b91a2305e2f292627d157892b.zip
add nfs role
Diffstat (limited to '')
-rw-r--r--roles/nfs/templates/exports.j211
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/nfs/templates/exports.j2 b/roles/nfs/templates/exports.j2
new file mode 100644
index 0000000..301bb45
--- /dev/null
+++ b/roles/nfs/templates/exports.j2
@@ -0,0 +1,11 @@
+{% set _opts = 'rw,sync,insecure,no_subtree_check' %}
+{% if nfs_opts %}
+ {% set _opts %}{{ _opts }},{{ nfs_opts }}{% endset %}
+{% endif %}
+{% if nfs_all_squash %}
+ {% set _anonuid = nfs_anonuid if nfs_anonuid is defined else ansible_facts['user_uid'] %}
+ {% set _anongid = nfs_anongid if nfs_anongid is defined else ansible_facts['user_gid'] %}
+ {% set _opts %}{{ _opts }},all_squash,anonuid={{ _anonuid }},anongid={{ _anongid }}{% endset %}
+{% endif %}
+
+{{ nfs_dir }} *({{ _opts }})