Puppet Class: systemd::resolved

Defined in:
modules/systemd/manifests/resolved.pp

Overview

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')

    ensurable paramter

  • dns (Array[Stdlib::IP::Address]) (defaults to: [])

    A array of IPv4 and IPv6 addresses to use as system DNS servers

  • fallback_dns (Array[Stdlib::IP::Address]) (defaults to: [])

    A array of IPv4 and IPv6 addresses to use as the fallback DNS servers

  • domains (Array[String]) (defaults to: [])

    A array of search domains

  • enable_llmnr (Variant[Enum['resolve'], Boolean]) (defaults to: false)

    enable Link-Local Multicast Name Resolution support, If set to “resolve”, only resolution support is enabled

  • enable_mdns (Variant[Enum['resolve'], Boolean]) (defaults to: false)

    enable Multicast DNS support, If set to “resolve”, only resolution support is enabled

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

    enable dnssec validation

  • enable_dtls (Variant[Enum['opportunistic'], Boolean ]) (defaults to: false)

    enable DNS over TLS

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

    enable the cache

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

    enable the stub listener

  • read_etc_hosts (Boolean) (defaults to: true)

    read /etc/hosts, and try to resolve hosts or address by using the entries in the file before sending query to DNS servers.

  • link_resolv_conf (Boolean) (defaults to: true)


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'modules/systemd/manifests/resolved.pp', line 19

class systemd::resolved (
    Wmflib::Ensure                            $ensure            = 'present',
    Array[Stdlib::IP::Address]                $dns               = [],
    Array[Stdlib::IP::Address]                $fallback_dns      = [],
    Array[String]                             $domains           = [],
    Variant[Enum['resolve'], Boolean]         $enable_llmnr      = false,
    Variant[Enum['resolve'], Boolean]         $enable_mdns       = false,
    Variant[Enum['allow-downgrade'], Boolean] $dnssec            = 'allow-downgrade',
    Variant[Enum['opportunistic'], Boolean ]  $enable_dtls       = false,
    Variant[Enum['no-negative'], Boolean]     $enable_cache      = true,
    Variant[Enum['tcp', 'udp'], Boolean]      $dns_stub_listener = true,
    Boolean                                   $read_etc_hosts    = true,
    Boolean                                   $link_resolv_conf  = true,
) {
    $enable = $ensure ? {
      'absent' => false,
      default  => true,
    }

    file{'/etc/resolv.conf':
        ensure => stdlib::ensure($link_resolv_conf, 'link'),
        target => '/run/systemd/resolve/stub-resolv.conf',
    }
    file {'/etc/systemd/resolved.conf':
      ensure  => file,
      content => template('systemd/resolved.conf.erb'),
      notify  => Service['systemd-resolved'],
    }
    service { 'systemd-resolved':
      ensure => stdlib::ensure($ensure, 'service'),
      enable => $enable,
    }
}