From ce73aab536e5cf3b91a2305e2f292627d157892b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 17 Dec 2024 05:38:20 +0100 Subject: add nfs role --- roles/nfs/templates/exports.j2 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 roles/nfs/templates/exports.j2 (limited to 'roles/nfs/templates/exports.j2') 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 }}) -- cgit v1.2.3