Puppet Class: systemd

Defined in:
manifests/init.pp

Overview

This module allows triggering systemd commands once for all modules

Parameters:

  • service_limits (Hash[String[1],Hash[String[1], Any]]) (defaults to: {})

    May be passed a resource hash suitable for passing directly into the “create_resources()“ function as called on “systemd::service_limits“

  • networks (Hash[String[1],Hash[String[1], Any]]) (defaults to: {})

    Hash of ‘systemd::network` resources

  • timers (Hash[String[1],Hash[String[1], Any]]) (defaults to: {})

    Hash of ‘systemd::timer` resources

  • tmpfiles (Hash[String[1],Hash[String[1], Any]]) (defaults to: {})

    Hash of ‘systemd::tmpfile` resources

  • unit_files (Hash[String[1],Hash[String[1], Any]]) (defaults to: {})

    Hash of ‘systemd::unit_file` resources

  • manage_resolved (Boolean) (defaults to: false)

    Manage the systemd resolver

  • resolved_ensure (Enum['stopped','running']) (defaults to: 'running')

    The state that the “resolved“ service should be in

  • dns (Optional[Variant[Array[String],String]]) (defaults to: undef)

    A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. DNS requests are sent to one of the listed DNS servers in parallel to suitable per-link DNS servers acquired from systemd-networkd.service(8) or set at runtime by external applications. requires puppetlabs-inifile

  • fallback_dns (Optional[Variant[Array[String],String]]) (defaults to: undef)

    A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. Any per-link DNS servers obtained from systemd-networkd take precedence over this setting. requires puppetlabs-inifile

  • domains (Optional[Variant[Array[String],String]]) (defaults to: undef)

    A space-separated list of domains host names or IP addresses to be used systemd-resolved take precedence over this setting.

  • llmnr (Optional[Variant[Boolean,Enum['resolve']]]) (defaults to: undef)

    Takes a boolean argument or “resolve”.

  • multicast_dns (Optional[Variant[Boolean,Enum['resolve']]]) (defaults to: undef)

    Takes a boolean argument or “resolve”.

  • dnssec (Optional[Variant[Boolean,Enum['allow-downgrade']]]) (defaults to: undef)

    Takes a boolean argument or “allow-downgrade”.

  • dnsovertls (Variant[Boolean,Enum['yes', 'opportunistic', 'no']]) (defaults to: false)

    Takes a boolean argument or one of “yes”, “opportunistic” or “no”. “true” corresponds to “opportunistic” and “false” (default) to “no”.

  • cache (Variant[Boolean,Enum['no-negative']]) (defaults to: false)

    Takes a boolean argument or “no-negative”.

  • dns_stub_listener (Optional[Variant[Boolean,Enum['udp','tcp']]]) (defaults to: undef)

    Takes a boolean argument or one of “udp” and “tcp”.

  • use_stub_resolver (Boolean) (defaults to: false)

    Takes a boolean argument. When “false” (default) it uses /run/systemd/resolve/resolv.conf as /etc/resolv.conf. When “true”, it uses /run/systemd/resolve/stub-resolv.conf

  • manage_networkd (Boolean) (defaults to: false)

    Manage the systemd network daemon

  • networkd_ensure (Enum['stopped','running']) (defaults to: 'running')

    The state that the “networkd“ service should be in

  • manage_timesyncd (Boolean) (defaults to: false)

    Manage the systemd tiemsyncd daemon

  • timesyncd_ensure (Enum['stopped','running']) (defaults to: 'running')

    The state that the “timesyncd“ service should be in

  • ntp_server (Optional[Variant[Array,String]]) (defaults to: undef)

    comma separated list of ntp servers, will be combined with interface specific addresses from systemd-networkd. requires puppetlabs-inifile

  • fallback_ntp_server (Optional[Variant[Array,String]]) (defaults to: undef)

    A space-separated list of NTP server host names or IP addresses to be used as the fallback NTP servers. Any per-interface NTP servers obtained from systemd-networkd take precedence over this setting. requires puppetlabs-inifile

  • manage_journald (Boolean) (defaults to: true)

    Manage the systemd journald

  • journald_settings (Systemd::JournaldSettings) (defaults to: {})

    Config Hash that is used to configure settings in journald.conf

  • manage_udevd (Boolean) (defaults to: false)

    Manage the systemd udev daemon

  • udev_log (Optional[Variant[Integer,String]]) (defaults to: undef)

    The value of /etc/udev/udev.conf udev_log

  • udev_children_max (Optional[Integer]) (defaults to: undef)

    The value of /etc/udev/udev.conf children_max

  • udev_exec_delay (Optional[Integer]) (defaults to: undef)

    The value of /etc/udev/udev.conf exec_delay

  • udev_event_timeout (Optional[Integer]) (defaults to: undef)

    The value of /etc/udev/udev.conf event_timeout

  • udev_resolve_names (Optional[Enum['early', 'late', 'never']]) (defaults to: undef)

    The value of /etc/udev/udev.conf resolve_names

  • udev_timeout_signal (Optional[Variant[Integer,String]]) (defaults to: undef)

    The value of /etc/udev/udev.conf timeout_signal

  • udev_rules (Hash) (defaults to: {})

    Config Hash that is used to generate instances of our ‘udev::rule` define.

  • manage_logind (Boolean) (defaults to: false)

    Manage the systemd logind

  • logind_settings (Systemd::LogindSettings) (defaults to: {})

    Config Hash that is used to configure settings in logind.conf

  • loginctl_users (Hash) (defaults to: {})

    Config Hash that is used to generate instances of our type ‘loginctl_user`.

  • dropin_files (Hash) (defaults to: {})

    Configure dropin files via hiera with factory pattern

  • manage_all_network_files (Boolean) (defaults to: false)
  • network_path (Stdlib::Absolutepath) (defaults to: '/etc/systemd/network')

    where all networkd files are placed in

  • manage_accounting (Boolean) (defaults to: false)

    when enabled, the different accounting options (network traffic, IO, CPU util…) are enabled for units

  • accounting (Hash[String,String]) (defaults to: {})

    Hash of the different accounting options. This highly depends on the used systemd version. The module provides sane defaults per operating system using Hiera.

  • purge_dropin_dirs (Boolean) (defaults to: true)

    When enabled, unused directories for dropin files will be purged



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'manifests/init.pp', line 143

class systemd (
  Hash[String,String]                                 $accounting = {},
  Hash[String[1],Hash[String[1], Any]]                $service_limits = {},
  Hash[String[1],Hash[String[1], Any]]                $networks = {},
  Hash[String[1],Hash[String[1], Any]]                $timers = {},
  Hash[String[1],Hash[String[1], Any]]                $tmpfiles = {},
  Hash[String[1],Hash[String[1], Any]]                $unit_files = {},
  Boolean                                             $manage_resolved = false,
  Enum['stopped','running']                           $resolved_ensure = 'running',
  Optional[Variant[Array[String],String]]             $dns = undef,
  Optional[Variant[Array[String],String]]             $fallback_dns = undef,
  Optional[Variant[Array[String],String]]             $domains = undef,
  Optional[Variant[Boolean,Enum['resolve']]]          $llmnr = undef,
  Optional[Variant[Boolean,Enum['resolve']]]          $multicast_dns = undef,
  Optional[Variant[Boolean,Enum['allow-downgrade']]]  $dnssec = undef,
  Variant[Boolean,Enum['yes', 'opportunistic', 'no']] $dnsovertls = false,
  Variant[Boolean,Enum['no-negative']]                $cache = false,
  Optional[Variant[Boolean,Enum['udp','tcp']]]        $dns_stub_listener = undef,
  Boolean                                             $use_stub_resolver = false,
  Boolean                                             $manage_networkd = false,
  Enum['stopped','running']                           $networkd_ensure = 'running',
  Boolean                                             $manage_timesyncd = false,
  Enum['stopped','running']                           $timesyncd_ensure = 'running',
  Optional[Variant[Array,String]]                     $ntp_server = undef,
  Optional[Variant[Array,String]]                     $fallback_ntp_server = undef,
  Boolean                                             $manage_accounting = false,
  Boolean                                             $purge_dropin_dirs = true,
  Boolean                                             $manage_journald = true,
  Systemd::JournaldSettings                           $journald_settings = {},
  Boolean                                             $manage_udevd = false,
  Optional[Variant[Integer,String]]                   $udev_log = undef,
  Optional[Integer]                                   $udev_children_max = undef,
  Optional[Integer]                                   $udev_exec_delay = undef,
  Optional[Integer]                                   $udev_event_timeout = undef,
  Optional[Enum['early', 'late', 'never']]            $udev_resolve_names = undef,
  Optional[Variant[Integer,String]]                   $udev_timeout_signal = undef,
  Boolean                                             $manage_logind = false,
  Systemd::LogindSettings                             $logind_settings = {},
  Boolean                                             $manage_all_network_files = false,
  Stdlib::Absolutepath                                $network_path = '/etc/systemd/network',
  Hash                                                $loginctl_users = {},
  Hash                                                $dropin_files = {},
  Hash                                                $udev_rules = {},
) {
  $service_limits.each |$service_limit, $service_limit_data| {
    systemd::service_limits { $service_limit:
      * => $service_limit_data,
    }
  }
  $networks.each |$network, $network_data| {
    systemd::network { $network:
      * => $network_data,
    }
  }
  $timers.each |$timer, $timer_data| {
    systemd::timer { $timer:
      * => $timer_data,
    }
  }
  $tmpfiles.each |$tmpfile, $tmpfile_data| {
    systemd::tmpfile { $tmpfile:
      * => $tmpfile_data,
    }
  }
  $unit_files.each |$unit_file, $unit_file_data| {
    systemd::unit_file { $unit_file:
      * => $unit_file_data,
    }
  }

  if $manage_resolved and $facts['systemd_internal_services'] and $facts['systemd_internal_services']['systemd-resolved.service'] {
    contain systemd::resolved
  }

  if $manage_networkd and $facts['systemd_internal_services'] and $facts['systemd_internal_services']['systemd-networkd.service'] {
    contain systemd::networkd
  }

  if $manage_timesyncd and $facts['systemd_internal_services'] and $facts['systemd_internal_services']['systemd-timesyncd.service'] {
    contain systemd::timesyncd
  }

  if $manage_udevd {
    contain systemd::udevd
  }

  if $manage_accounting {
    contain systemd::system
  }

  if $manage_journald {
    contain systemd::journald
  }

  if $manage_logind {
    contain systemd::logind
  }

  $dropin_files.each |$name, $resource| {
    systemd::dropin_file { $name:
      * => $resource,
    }
  }
}