Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >=4.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'pk-systemd', '1.2.0'
Learn more about managing modules with a PuppetfileDocumentation
systemd
Overview
This module manages systemd configuration files.
Module Description
Manages systemd unit files in /etc/systemd/system. The base ::systemd class provides some pertinent system-wide variables. The following defined types manage systemd unit file instances.
systemd::unit
manages the content of systemd unit configuration files. Used by
type specific manifests in the systemd::unit:: namespace.
systemd::unitfrag
manages the content auxiliary systemd unit configuration files that
supplements a unit's main configuration. This is useful to manage selected
unit settings if the main configuration file is maintained by other means,
e.g. in an application package.
Example:
systemd::unitfrag { 'apache:;service::umask':
ensure => 'present',
unit_name => $::apache::service_name,
unit_type => 'service',
frag_name => 'umask',
type_options => { 'UMask' => $service_umask },
notify => Service[$::apache::service_name],
}
This manages an auxiliary systemd configuration file in '/etc/systemd/system/apache.service.d/'
that causes the UMask options to merged into the apache service systemd settings.
systemd::service::simple
manages a simple service unit. Parameters correspond to a subset of
unit file directives
Example:
systemd::service::simple { $service_name:
description => 'Tomcat App',
cond_path_is_directory => $catalina_home,
service_user => $user,
service_group => $group,
service_type => 'forking',
exec_start => "${catalina_home}/bin/startup.sh",
exec_stop => "${catalina_home}/bin/shutdown.sh",
}
Defines a systemd unit that runs a tomcat-based application as a service.
systemd::service::custom
manages an arbitrary systemd unit file based on a custom configuration
file source.
The following resources in the systemd::unit namespace have parameters that represent typical unit-specific configuration options. All of them accept parameters ('*_options') that allow any systemd options to be configured. These parameters accept an array of values, which result in systemd directives with values separated by spaces. The first element in an array of values passed to the puppet resources is treated specially: if this element is the empty string or the reserved word 'RESET', then a systemd configuration line of the form "Directive=" is generated, which effectively resets this directive in the systemd unit.
Note that in all system::unit resources, the 'description' parameter is mandatory.
systemd::unit::mount
manages a systemd mount unit.
systemd::unit::automount
manages a systemd automount unit and also the accompanying mandatory
mount unit.
Example:
systemd::unit::automount { 'rhome':
ensure => present,
description => 'Remote home directories volumes',
where => '/home',
what => 'stores.example.org:/home',
type => 'nfs',
options => 'nolock,noatime,bg',
idle_timeout => 900
}
Defines both a systemd automount and its associated mount unit to manage a
NFS-based remote volume with automatic unmount after 15 minutes of inactivity.
systemd::unit::service
manages a systemd service unit.
systemd::unit::socket
manages a systemd socket unit.
systemd::unit::timer
manages a systemd timer unit.
systemd::unit::path
manages a systemd path unit.
Change log
Release [1.2.0]
Summary
Feature: systemd::service::simple: make all systemd settings available through parameters systemd::unit::timer bug fix
Added
- systemd::dropin_file: this defined resource for compatibility with the voxpopuli module which also occupies the '::systemd' namespace.
Fixed
- systemd::unit::timer: fix errors in type_option values
Release [1.1.0]
Summary
Feature: systemd directive reset option
Added
- systemd::functions::formatkv: support for resetting multi-valued systemd unit directives
Release [1.0.1]
Summary
Bugfix release
Fixed
- systemd::service::simple_service: fix spelling of 'Environment' parameters
- systemd::functions::formatkv: remove space form key/value declaration (from runejuhl)