|
13 | 13 | # Export root, where we bind mount shares, default /export
|
14 | 14 | #
|
15 | 15 | # [nfs_v4_idmap_domain]
|
16 |
| -# Domain setting for idmapd, must be the same across server |
17 |
| -# and clients. |
18 |
| -# Default is to use $domain fact. |
| 16 | +# Domain setting for idmapd, must be the same across server |
| 17 | +# and clients. |
| 18 | +# Default is to use $domain fact. |
| 19 | +# |
| 20 | +# [service_manage] |
| 21 | +# Should this class manage the services behind nfs? Set this to false |
| 22 | +# if you are managing the service in another way (e.g. pacemaker). |
19 | 23 | #
|
20 | 24 | # === Examples
|
21 | 25 | #
|
|
29 | 33 | # }
|
30 | 34 |
|
31 | 35 | class nfs::server (
|
32 |
| - $nfs_v4 = $nfs::params::nfs_v4, |
| 36 | + $nfs_v4 = $nfs::params::nfs_v4, |
33 | 37 | $nfs_v4_export_root = $nfs::params::nfs_v4_export_root,
|
34 | 38 | $nfs_v4_export_root_clients = $nfs::params::nfs_v4_export_root_clients,
|
35 | 39 | $nfs_v4_idmap_domain = $nfs::params::nfs_v4_idmap_domain,
|
36 | 40 | #
|
| 41 | + $service_manage = true, |
| 42 | + # |
37 | 43 | $nfs_v4_root_export_ensure = 'mounted',
|
38 | 44 | $nfs_v4_root_export_mount = undef,
|
39 | 45 | $nfs_v4_root_export_remounts = false,
|
|
42 | 48 | $nfs_v4_root_export_bindmount = undef,
|
43 | 49 | $nfs_v4_root_export_tag = undef,
|
44 | 50 | #
|
45 |
| - $mountd_port = undef, |
46 |
| - $mountd_threads = 1 |
| 51 | + $mountd_port = undef, |
| 52 | + $mountd_threads = 1, |
| 53 | + # |
| 54 | + $exports = undef, |
47 | 55 | ) inherits nfs::params {
|
48 | 56 |
|
| 57 | + validate_bool($nfs_v4) |
| 58 | + validate_bool($service_manage) |
| 59 | + validate_bool($nfs_v4_root_export_remounts) |
| 60 | + validate_bool($nfs_v4_root_export_atboot) |
| 61 | + |
49 | 62 | class { "nfs::server::${::nfs::params::osfamily}":
|
50 | 63 | nfs_v4 => $nfs_v4,
|
51 | 64 | nfs_v4_idmap_domain => $nfs_v4_idmap_domain,
|
52 | 65 | mountd_port => $mountd_port,
|
53 | 66 | mountd_threads => $mountd_threads,
|
| 67 | + service_manage => $service_manage, |
54 | 68 | }
|
55 | 69 |
|
56 | 70 | include nfs::server::configure
|
57 | 71 |
|
| 72 | + if $exports { |
| 73 | + create_resources(nfs::server::export, $exports) |
| 74 | + } |
| 75 | + |
58 | 76 | }
|
0 commit comments