roles/nfs: Improved var usages

- Extracted global_nfs_directory from default root_directory
- Added usage of export_path
dehydrated
Felix Stupp 4 years ago
parent 666f463b46
commit 2515ab82db
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -71,6 +71,7 @@ global_ip_discover_register_pass: "{{ lookup('password', 'credentials/ip_discove
global_interfaces_directory: "/etc/network/interfaces.d"
global_nfs_port: "2049" # for version 4
global_nfs_directory: "{{ global_webservers_directory }}/nfs"
global_pamd: "/etc/pam.d"

@ -2,7 +2,7 @@
export_name: "{{ real_path | basename }}"
# real_path: "/exported/path"
export_path: "{{ root_directory }}/{{ export_name }}"
export_path: "{{ global_nfs_directory }}/{{ export_name }}"
export_config_name: "{{ export_name | regex_replace('/', '-') }}"
mount_unit_name: "{{ export_path | regex_replace('^/') | regex_replace('/', '-') }}.mount"

@ -1,4 +1,4 @@
{{ root_directory }}/{{ export_name }} {% for host in export_hosts -%}
{{ export_path }} {% for host in export_hosts -%}
{{ host }}({{ readonly | ternary('ro', 'rw') }},sync
{%- if squash_user != "" -%}
,all_squash,anonuid={{ user_info.uid }},anongid={{ user_info.group }}

@ -1,6 +1,4 @@
---
root_directory: "{{ global_webservers_directory }}/nfs"
exports_config: "/etc/exports"
exports_config_directory: "/etc/exports.d"

@ -9,7 +9,7 @@
- name: Create exports root directory
file:
state: directory
path: "{{ root_directory }}"
path: "{{ global_nfs_directory }}"
owner: root
group: root
mode: u=rwx,g=rx,o=rx

@ -1 +1 @@
{{ root_directory }} *(ro,sync,all_squash,no_subtree_check,fsid=root)
{{ global_nfs_directory }} *(ro,sync,all_squash,no_subtree_check,fsid=root)

Loading…
Cancel
Save