Puppet Class: systemd

Defined in:
manifests/init.pp

Overview

This module allows triggering systemd commands once for all modules

Parameters:

  • service_limits (Hash[String,Hash[String, Any]])

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

  • manage_resolved (Boolean)

    Manage the systemd resolver

  • resolved_ensure (Enum['stopped','running'])

    The state that the “resolved“ service should be in

  • dns (Optional[Variant[Array[String],String]])

    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]])

    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]])

    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']]])

    Takes a boolean argument or “resolve”.

  • multicast_dns (Optional[Variant[Boolean,Enum['resolve']]])

    Takes a boolean argument or “resolve”.

  • dnssec (Optional[Variant[Boolean,Enum['allow-downgrade']]])

    Takes a boolean argument or “allow-downgrade”.

  • dnsovertls (Optional[Variant[Boolean,Enum['opportunistic', 'no']]])

    Takes a boolean argument or “opportunistic”

  • cache (Boolean)

    Takes a boolean argument.

  • dns_stub_listener (Optional[Variant[Boolean,Enum['udp','tcp']]])

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

  • use_stub_resolver (Boolean)

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

  • manage_networkd (Boolean)

    Manage the systemd network daemon

  • networkd_ensure (Enum['stopped','running'])

    The state that the “networkd“ service should be in

  • manage_timesyncd (Boolean)

    Manage the systemd tiemsyncd daemon

  • timesyncd_ensure (Enum['stopped','running'])

    The state that the “timesyncd“ service should be in

  • ntp_server (Optional[Variant[Array,String]])

    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]])

    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)

    Manage the systemd journald

  • journald_settings (Systemd::JournaldSettings)

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

  • manage_logind (Boolean)

    Manage the systemd logind

  • logind_settings (Systemd::LogindSettings)

    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_accounting (Boolean)
  • accounting (Hash[String,String])
  • purge_dropin_dirs (Boolean)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'manifests/init.pp', line 90

class systemd (
  Hash[String,Hash[String, Any]]                         $service_limits,
  Boolean                                                $manage_resolved,
  Enum['stopped','running']                              $resolved_ensure,
  Optional[Variant[Array[String],String]]                $dns,
  Optional[Variant[Array[String],String]]                $fallback_dns,
  Optional[Variant[Array[String],String]]                $domains,
  Optional[Variant[Boolean,Enum['resolve']]]             $llmnr,
  Optional[Variant[Boolean,Enum['resolve']]]             $multicast_dns,
  Optional[Variant[Boolean,Enum['allow-downgrade']]]     $dnssec,
  Optional[Variant[Boolean,Enum['opportunistic', 'no']]] $dnsovertls,
  Boolean                                                $cache,
  Optional[Variant[Boolean,Enum['udp','tcp']]]           $dns_stub_listener,
  Boolean                                                $use_stub_resolver,
  Boolean                                                $manage_networkd,
  Enum['stopped','running']                              $networkd_ensure,
  Boolean                                                $manage_timesyncd,
  Enum['stopped','running']                              $timesyncd_ensure,
  Optional[Variant[Array,String]]                        $ntp_server,
  Optional[Variant[Array,String]]                        $fallback_ntp_server,
  Boolean                                                $manage_accounting,
  Hash[String,String]                                    $accounting,
  Boolean                                                $purge_dropin_dirs,
  Boolean                                                $manage_journald,
  Systemd::JournaldSettings                              $journald_settings,
  Boolean                                                $manage_logind,
  Systemd::LogindSettings                                $logind_settings,
  Hash                                                   $loginctl_users = {},
  Hash                                                   $dropin_files = {},
) {
  contain systemd::systemctl::daemon_reload

  create_resources('systemd::service_limits', $service_limits)

  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_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,
    }
  }
}