| Puppet Version: 6.23.0 Puppet Server Version: N/A OS Name/Version: After the release of Puppet 6.23.0 I've had to modify my manifests to workaround an issue affecting testing with rspec-puppet. In my testing environment (a jenkins agent in an unprivileged docker container), the following code (intended for RHEL7 running systemd)
if versioncmp($facts['operatingsystemmajrelease'], '7') >= 0 { |
service { 'mcollective': |
ensure => 'stopped', |
enable => 'mask', |
} |
}
|
has started throwing
Provider redhat must have features 'maskable' to set 'enable' to 'mask' |
due to the changes made in https://github.com/puppetlabs/puppet/commit/8d6c5ba92076babba07a42d8f82c9e6f86f8ef8b This line https://github.com/puppetlabs/puppet/blob/aa1df95ab3c8ee5bd8f007ba45cca422b1de2498/lib/puppet/provider/service/systemd.rb#L14 is executed to help determine the default service provider. During rspec-puppet testing this code is being executed on the test environment platform, which may or may not be detected as systemd. (In my case, it isn't because I'm in a docker container, but equally the default service provider of eg. Mac OS is also not systemd). Not sure what the solution to this could be. The new validation code isn't 'wrong', but rspec-puppet wants to test code against various OSes by using stubbed facts. Since the systemd service provider is confined based on the actual presence of systemd and not facts, this no longer works. |