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)
  • enable_wikidough (Boolean) (defaults to: true)
  • doh_paths (Array[String[1]]) (defaults to: ['/', '/dns-query'])
  • enable_packetcache (Boolean) (defaults to: true)
  • packetcache_max (Integer[1]) (defaults to: 10000000)
  • ringbuffer_max (Integer[1]) (defaults to: 10)
  • tcp_client_threads_max (Integer[1]) (defaults to: 20)
  • enable_console (Boolean) (defaults to: false)
  • console_key (Optional[String]) (defaults to: undef)
  • enable_webserver (Boolean) (defaults to: false)
  • drop_querytype_any (Boolean) (defaults to: true)
  • webserver (Optional[Dnsdist::Webserver_config]) (defaults to: undef)
  • enable_ecs (Boolean) (defaults to: true)
  • enable_landing (Boolean) (defaults to: false)
  • landing_text (Optional[String]) (defaults to: undef)
  • custom_headers (Dnsdist::Http_headers) (defaults to: {})


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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'modules/dnsdist/manifests/init.pp', line 66

class dnsdist (
    Dnsdist::Resolver                   $resolver,
    Dnsdist::TLS_common                 $tls_common,
    Dnsdist::TLS_config                 $tls_config_doh,
    Dnsdist::TLS_config                 $tls_config_dot,
    Boolean                             $enable_wikidough       = true,
    Array[String[1]]                    $doh_paths              = ['/', '/dns-query'],
    Boolean                             $enable_packetcache     = true,
    Integer[1]                          $packetcache_max        = 10000000,
    Integer[1]                          $ringbuffer_max         = 10,
    Integer[1]                          $tcp_client_threads_max = 20,
    Boolean                             $enable_console         = false,
    Optional[String]                    $console_key            = undef,
    Boolean                             $enable_webserver       = false,
    Boolean                             $drop_querytype_any     = true,
    Optional[Dnsdist::Webserver_config] $webserver              = undef,
    Boolean                             $enable_ecs             = true,
    Boolean                             $enable_landing         = false,
    Optional[String]                    $landing_text           = undef,
    Dnsdist::Http_headers               $custom_headers         = {},
) {

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

    if ($enable_webserver and $webserver == 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        => '_dnsdist',
        mode         => '0440',
        content      => template('dnsdist/dnsdist.conf.erb'),
        validate_cmd => '/usr/bin/dnsdist --check-config --config %',
    }

    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 => '/bin/systemctl reload dnsdist.service',
            enable  => true,
        },
    }

}