Puppet Class: nfs::idmapd::server
- Defined in:
- manifests/idmapd/server.pp
Summary
Manage the `idmapd` server configuration and serviceOverview
Enables or masks ‘rpc-idmapd.service` per `nfs::idmapd`.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'manifests/idmapd/server.pp', line 8
class nfs::idmapd::server
{
assert_private()
if $nfs::idmapd {
include 'nfs::idmapd::config'
service { 'nfs-idmapd.service':
ensure => 'running',
enable => true,
hasrestart => true
}
Class['nfs::idmapd::config'] ~> Service['nfs-idmapd.service']
# Service will be masked if previous config had disallowed idmapd
exec { 'unmask_nfs-idmapd.service':
command => '/usr/bin/systemctl unmask nfs-idmapd.service',
onlyif => '/usr/bin/systemctl status nfs-idmapd.service | /usr/bin/grep -qw masked',
notify => Service['nfs-idmapd.service']
}
} else {
# 'service { NAME: enable => mask }' does not seem to work in puppet.
# So, we will enforce masking of the service here.
service { 'nfs-idmapd.service':
ensure => 'stopped'
}
exec { 'mask_nfs-idmapd.service':
command => '/usr/bin/systemctl mask nfs-idmapd.service',
unless => '/usr/bin/systemctl status nfs-idmapd.service | /usr/bin/grep -qw masked',
require => Service['nfs-idmapd.service']
}
}
}
|