service { 'nfs':
enable => true,
ensure => running,
}[root@server ~]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for server
Info: Applying configuration version '1573029117'
Notice: /Stage[main]/Flex::Profiles::Archive::Server/Service[nfs]/ensure: ensure changed 'stopped' to 'running' (corrective)
Info: /Stage[main]/Flex::Profiles::Archive::Server/Service[nfs]: Unscheduling refresh on Service[nfs]
Notice: Applied catalog in 18.92 seconds
[root@server ~]# service nfs status
Redirecting to /bin/systemctl status nfs.service
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Drop-In: /run/systemd/generator/nfs-server.service.d
└─order-with-mounts.conf
Active: active (exited) since Fri 2019-11-01 20:31:00 GMT; 4 days ago
Main PID: 28173 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[root@server ~]# systemctl cat nfs
# /usr/lib/systemd/system/nfs-server.service
[Unit]
Description=NFS server and services
DefaultDependencies=no
Requires= network.target proc-fs-nfsd.mount
Requires= nfs-mountd.service
Wants=rpcbind.socket network-online.target
Wants=rpc-statd.service nfs-idmapd.service
Wants=rpc-statd-notify.service
After= network-online.target local-fs.target
After= proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
After= nfs-idmapd.service rpc-statd.service
Before= rpc-statd-notify.service
# GSS services dependencies and ordering
Wants=auth-rpcgss-module.service
After=rpc-gssd.service gssproxy.service
Wants=nfs-config.service
After=nfs-config.service
[Service]
EnvironmentFile=-/run/sysconfig/nfs-utils
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/sbin/exportfs -r
ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
ExecStartPost=-/bin/sh -c 'if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi'
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f
ExecReload=-/usr/sbin/exportfs -r
[Install]
WantedBy=multi-user.target
# /run/systemd/generator/nfs-server.service.d/order-with-mounts.conf
# Automatically generated by nfs-server-generator
[Unit]
RequiresMountsFor=/export/nfs/sl1-uat-permtestservice { 'nfs':
enable => true,
ensure => running,
}
Nice and simple however on every puppet run we get the following output which is recorded as a change:
[root@server ~]# systemctl cat nfs
# /usr/lib/systemd/system/nfs-server.service
Name mismatch. Use "nfs-server" in your resource.
HTH...
Dirk
--
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5b3b2cde-db75-400d-85f9-2e9cbc995dc8%40googlegroups.com.