Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 7.5.0
-
Coremunity
-
Platform Core KANBAN
-
Needs Assessment
-
Bug Fix
-
It's now possible to mask a systemd service that doesn't (yet) exist.
-
Needs Assessment
Description
Puppet Version: 6.21.1, 7.5.0
Puppet Server Version: N/A
OS Name/Version: CentOS 7
With the systemd provider, setting enable to mask on a service that does not exist fails.
Desired Behavior:
Masking a service should work whether or not the service exists (the way that setting enable to false works either way).
Actual Behavior:
[root@puppet ~]# systemctl list-unit-files | grep madeup
|
[root@puppet ~]# puppet resource service madeup
|
service { 'madeup':
|
ensure => 'stopped',
|
enable => 'false',
|
provider => 'systemd',
|
}
|
[root@puppet ~]# puppet resource service madeup enable=mask
|
Error: Could not disable madeup:
|
Error: /Service[madeup]/enable: change from 'false' to 'mask' failed: Could not disable madeup:
|
service { 'madeup':
|
enable => 'false',
|
provider => 'systemd',
|
}
|
[root@puppet ~]# systemctl mask madeup
|
Created symlink from /etc/systemd/system/madeup.service to /dev/null.
|
[root@puppet ~]# systemctl list-unit-files | grep madeup
|
madeup.service masked
|
The error here appears to be coming from https://github.com/puppetlabs/puppet/blob/85bd9ed07e3e6c956f1972624a50be914292e1ab/lib/puppet/provider/service/systemd.rb#L162. If I wrap that in a begin block, the service is masked properly.
Attachments
Issue Links
- is duplicated by
-
PUP-10814 Impossible to systemctl mask non-existing service
-
- Closed
-