Skip to content

Commit

Permalink
Make nfs mount automount with systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Aug 25, 2023
1 parent 9dc1712 commit c32581d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/profile/manifests/nfs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@
$devices = lookup('profile::nfs::server::devices', undef, undef, {})
if $devices =~ Hash[String, Array[String]] {
$nfs_export_list = keys($devices)
$options_nfsv4 = 'proto=tcp,nosuid,nolock,noatime,actimeo=3,nfsvers=4.2,seclabel,bg'
$options_nfsv4 = 'proto=tcp,nosuid,nolock,noatime,actimeo=3,nfsvers=4.2,seclabel,x-systemd.automount,x-systemd.mount-timeout=30,_netdev'
$nfs_export_list.each | String $name | {
nfs::client::mount { "/${name}":
ensure => present,
server => $server_ip,
share => $name,
options_nfsv4 => $options_nfsv4,
notify => Systemd::Daemon_reload['nfs-automount'],
}
}
}
ensure_resource('systemd::daemon_reload', 'nfs-automount')
}

class profile::nfs::server (
Expand Down

0 comments on commit c32581d

Please sign in to comment.