Puppet Class: dnsdist

Defined in:
modules/dnsdist/manifests/init.pp

Overview

Parameters:

  • resolver (Dnsdist::Resolver)
  • tls_common (Dnsdist::TLS_common)
  • tls_config_doh (Dnsdist::TLS_config)
  • tls_config_dot (Dnsdist::TLS_config)
  • doh_base_url (String) (defaults to: '/dns-query')
  • qps_max (Integer[1]) (defaults to: 40)
  • enable_packetcache (Boolean) (defaults to: true)
  • packetcache_max (Integer[1]) (defaults to: 10000000)
  • ringbuffer_max (Integer[1]) (defaults to: 10)
  • enable_console (Boolean) (defaults to: false)
  • console_key (Optional[String]) (defaults to: undef)
  • enable_webserver (Boolean) (defaults to: false)
  • webserver_config (Optional[Dnsdist::Webserver_config]) (defaults to: undef)
  • enable_ecs (Boolean) (defaults to: true)


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'modules/dnsdist/manifests/init.pp', line 53

class dnsdist (
    Dnsdist::Resolver                   $resolver,
    Dnsdist::TLS_common                 $tls_common,
    Dnsdist::TLS_config                 $tls_config_doh,
    Dnsdist::TLS_config                 $tls_config_dot,
    String                              $doh_base_url       = '/dns-query',
    Integer[1]                          $qps_max            = 40,
    Boolean                             $enable_packetcache = true,
    Integer[1]                          $packetcache_max    = 10000000,
    Integer[1]                          $ringbuffer_max     = 10,
    Boolean                             $enable_console     = false,
    Optional[String]                    $console_key        = undef,
    Boolean                             $enable_webserver   = false,
    Optional[Dnsdist::Webserver_config] $webserver_config   = undef,
    Boolean                             $enable_ecs         = true,
) {

    if ($enable_console and $console_key == undef) {
        fail('Console access is enabled but no key was set.')
    }

    if ($enable_webserver and $webserver_config == undef) {
        fail('Web server access is enabled but no configuration was set.')
    }

    apt::package_from_component { 'dnsdist':
        component => 'component/dnsdist',
    }

    file { '/etc/dnsdist/dnsdist.conf':
        ensure  => 'present',
        require => Package['dnsdist'],
        owner   => 'root',
        group   => 'root',
        mode    => '0440',
        content => template('dnsdist/dnsdist.conf.erb'),
    }

    systemd::service { 'dnsdist':
        ensure         => present,
        override       => true,
        restart        => true,
        content        => template('dnsdist/dnsdist-systemd-override.conf.erb'),
        require        => [
            Package['dnsdist'],
            File['/etc/dnsdist/dnsdist.conf'],
        ],
        service_params => {
            restart => 'systemctl reload dnsdist.service',
            enable  => true,
        },
    }

}