|
5 | 5 |
|
6 | 6 | nfs_server_default: "{{ groups['control'] | first }}" # avoid using hostvars for compute-init
|
7 | 7 |
|
| 8 | +# only allow the nfs group IPs to mount nfs exports: |
| 9 | +nfs_export_clients_default: "{{ groups['nfs'] | map('extract', hostvars, 'ansible_host') | join(' ') }}" |
| 10 | +nfs_export_clients: "{{ nfs_export_clients_default }}" |
| 11 | + |
8 | 12 | nfs_configurations:
|
9 | 13 | - comment: Export /exports/home from Slurm control node as /home
|
10 | 14 | nfs_enable:
|
11 | 15 | server: "{{ inventory_hostname in groups['control'] }}"
|
12 |
| - # Don't mount share on server where it is exported from... |
13 |
| - # Could do something like `nfs_clients: "{{ 'nfs_servers' not in group_names }}"` instead. |
| 16 | + # Don't mount share on control node: |
14 | 17 | clients: "{{ inventory_hostname in groups['cluster'] and inventory_hostname not in groups['control'] }}"
|
15 | 18 | nfs_server: "{{ nfs_server_default }}"
|
16 | 19 | nfs_export: "/exports/home" # assumes skeleton TF is being used
|
17 | 20 | nfs_client_mnt_point: "/home"
|
18 | 21 | # prevent tunnelling and setuid binaries:
|
19 | 22 | # NB: this is stackhpc.nfs role defaults but are set here to prevent being
|
20 | 23 | # accidently overriden via default options
|
21 |
| - nfs_export_options: 'rw,secure,root_squash' |
| 24 | + nfs_export_options: 'rw,secure,root_squash' |
| 25 | + # prevent other IPs mounting the share: |
| 26 | + # NB: this is set as default for all shares above but is repeated here |
| 27 | + # to prevevent being accidently overriden when adding shares |
| 28 | + nfs_export_clients: "{{ nfs_export_clients_default }}" |
0 commit comments