Correct typing for IOReadIOPSMax, IOWriteIOPSMax,... in manage_unit a…
…nd manage_dropin.
Useing any of the following directives in `systemd::manage_dropin` or
`systemd::manage_unit` resulted in a compilation error.
* `IODeviceWeight`
* `IOReadBandwidthMax`
* `IOWriteBandwidthMax`
* `IOReadIOPSMax`
* `IOWriteIOPSMax`
The types for these directives in `Systemd::Unit::Slice` and
`Systemd::Unit::Service` have now been updated.
Example usage:
```puppet
systemd::manage_dropin { 'devicelimits.conf':
unit => 'special.service',
service_entry => {
'IOReadIOPSMax' => [
['/dev/afs',100],
['/dev/gluster','1000K'],
],
},
}
```
would result in a drop in file of:
```config
[Service]
IOReadIOPSMax=/dev/afs 100
IOReadIOPSMax=/dev/gluster 1000K
```Merge pull request #428 from /issues/291
Add parameter to manage /etc/udev/rules.d directory
Merge pull request #405 from voxpupuli/unit_file_ensure_absent_link
`systemd::unit_file`: Ensure link gets removed on `ensure => absent`
Merge pull request #430 from traylenator/devicew
Correct typing for IOReadIOPSMax, IOWriteIOPSMax,... in systemd::manage_dropin
Merge pull request #433 from schustersv/optional_service_restart
Make service restart upon unit file change optional
Don't allow ensure=file anymore
@cocker-cc correctly mentioned in 7f63dfa#commitcomment-139614892 that after #405 `ensure=file` breaks due to `stdlib::ensure` not being able to handle that. As `file` is any way only a synonym for `present`, let's just remove it from the possible values.
Create manage_unit, manage_dropin types from hiera
Units and dropins can now be created from hiera
records:
e.g.
```yaml
systemd::manage_dropins:
myconf.conf:
ensure: present
unit: myservice.service
service_entry:
Type: oneshot
ExecStart:
- ''
- '/usr/bin/doit.sh'
systemd::manage_units:
myservice.service:
unit_entry:
Description: My Customisation
service_entry:
CPUWeight: 2000
```
* Fixes #435Merge pull request #436 from traylenator/hiera
Create manage_unit, manage_dropin types from hiera
Use Stdlib::CreateResources type for hiera expansions
For a number of paramaters which generate resources typically from hiera files use `Stdlib::CreateResources` type. This requires a newer puppetlabs-stdlib module.
init: service_limits param: don't refer to create_resources
The code doesn't actually use create_resources anymore. This commit makes the doc string consistent with the other similar parameters.
Merge pull request #439 from kenyon/service_limits-doc
`init`: `service_limits` param: don't refer to `create_resources`
Merge pull request #434 from voxpupuli/unit_file_ensure
Don't allow ensure=file anymore for systemd::unit_file
Add NetworkNamespacePath as a valid unit service configuration
Merge pull request #441 from Valantin/bug-440
Add NetworkNamespacePath as a valid unit service configuration
remove resovled settings from config when changed to undef
fixes #397 Co-authored-by: Tim Meusel <tim@bastelfreak.de>
Merge pull request #438 from traylenator/create
Use Stdlib::CreateResources type for hiera expansions
Deprecate systemd::service_limits
The `systemd::service_limts` and corresponding type `Systemd::Servicelimits` is deprecated. Switch to `systemd::dropin_file` for a source attributed `systemd::service_limits` or `systemd::manage_unit` for a `limits` attributed `systemd::service_limits`.
Support reload of instances of systemd --user
This change increased the minimum required Puppet version to 6.24.0 or 7.9.0 [PUP-5704](https://puppet.atlassian.net/browse/PUP-5704) to support arrays to the command attribute of the exec type. Support the calling the `systemd --user daemon-reload` for a particular user. Example run: ```puppet notify{'junk': notify => Systemd::Daemon_reload['user_foobar'], } systemd::daemon_reload{'user_steve': user => 'steve', } ``` This results on a Fedora box: ``` Notice: /Stage[main]/Main/Notify[junk]/message: defined 'message' as 'junk' Notice: /Stage[main]/Main/Systemd::Daemon_reload[user_steve]/Package[systemd-container]: Triggered 'refresh' from 1 event Notice: /Stage[main]/Main/Systemd::Daemon_reload[user_steve]/Exec[systemd-user_steve-systemctl-user-steve-daemon-reload]: Triggered 'refresh' from 1 event ``` and a journal (debug on) for user@1000.service of ``` Mar 29 10:32:11 fedora systemd[2062]: Created slice background.slice - User Background Tasks Slice. Mar 29 10:32:11 fedora systemd[2062]: Starting systemd-tmpfiles-clean.service - Cleanup of User's Temporary Files and Directories... Mar 29 10:32:11 fedora systemd[2062]: Reloading requested from client PID 4379 ('systemctl')... Mar 29 10:32:11 fedora systemd[2062]: Reloading... Mar 29 10:32:11 fedora systemd[2062]: Reloading finished in 179 ms. Mar 29 10:32:11 fedora systemd[2062]: Finished systemd-tmpfiles-clean.service - Cleanup of User's Temporary Files and Directories. ... Only recent versions of `systemd-run` support the --machine option or actually manage to connect to DBUS.
New parameters to manage systemd-nspawn
New parameters `systemd::manage_nspawn` defaulting to false,
if true it will ensure that the `machinectl` and `systemd-nspawn`
commands are available.
When `true`.
```
{
systemd-nspawn@.service => "disabled",
}
```Merge pull request #444 from traylenator/nspawn
New parameters to manage systemd-nspawn
Manage unit running under systemd --user instance
New defined type `systemd::user_service` has two roles:
It can globally enable a user unit for all users. e.g:
```puppet
systemd::user_service { 'systemd-tmpfiles-clean.service':
enable => true,
global => true,
}
````
If can start/stop/enable/disable a service running for a particular
user. e.g
systemd::user_service { 'ssh-agent.socket':
ensure => 'running',
enable => true,
user => 'steve',
}
The type instance can also be notified to reload the unit running under
a `systemd --user` instance.
```puppet
file{ '/home/steve/.gpg.conf':
ensure => file,
content => "custom',
notify => Systemd::User_service['steve-gpg-agent.socket']
}
systemd::user_service { 'steve-gpg-agent.socket':
ensure => true,
enable => true,
user => 'steve',
}
```
Note - This merge request does not attempt to notify a
`systemd::daemon-reload{'user': user => 'steve'} instance at
the appropriate points. Solve that with real world experience.Merge pull request #446 from traylenator/userunit
Manage units running under `systemd --user` instance
Merge pull request #443 from traylenator/machinectl
Support reload of instances of systemd --user
Merge pull request #437 from traylenator/wrap
Deprecate `systemd::service_limits`
Debian 10 is dead upstream, we don't support it anymore.
Merge pull request #448 from bastelfreak/debian10
Drop EoL Debian 10 support
Correctly interpolate variables in service_limits
Fixes: 988d2c7 ("Deprecate `systemd::service_limits`")
Merge pull request #449 from ekohl/correct-service-limits-deprecation
Correctly interpolate variables in service_limits
Add test case for name of used types
a51bc39 fixed a bug add a test to catch next time.
Merge pull request #450 from traylenator/testcase
Add test case for interpolation bug in name of used types
Merge pull request #452 from /issues/451
remove `systemd::escape` usage for `timer_wrapper`
Merge pull request #429 from /issues/397
remove resolved settings from config when changed to `absent`
Merge pull request #457 from voxpupuli/modulesync
modulesync 7.5.0