summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config/manifests/caching_resolver.pp
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-01-16 13:08:24 -0500
committerMicah Anderson <micah@riseup.net>2013-01-16 13:08:24 -0500
commit4e0021dede8aae43760b3e9a4b2317c3ed4c1e0d (patch)
treec089b4373a1f8eca2b7586e4941eaa4d54008a04 /puppet/modules/site_config/manifests/caching_resolver.pp
parent06757bf230dc616832cf2eb560ee9c1570cc1a07 (diff)
Swtich from bind9 as the local caching resolver to unbound. This will enable us
to do tor lookups over DNS on servers, if tor services are defined. To do this, we remove the bind9 configurations from site_config::resolvconf.pp and replace it with site_config::caching_resolver with a basic unbound configuration that can be used everywhere. The unbound configuration enables a /etc/unbound/conf.d directory for additional config snippits that can be dropped in from other places. This will be used for setting up different interfaces in the vpn gateway, for example. There will be a set of transition package/file absent blocks to clean up providers.
Diffstat (limited to 'puppet/modules/site_config/manifests/caching_resolver.pp')
-rw-r--r--puppet/modules/site_config/manifests/caching_resolver.pp35
1 files changed, 35 insertions, 0 deletions
diff --git a/puppet/modules/site_config/manifests/caching_resolver.pp b/puppet/modules/site_config/manifests/caching_resolver.pp
new file mode 100644
index 00000000..e4374d8f
--- /dev/null
+++ b/puppet/modules/site_config/manifests/caching_resolver.pp
@@ -0,0 +1,35 @@
+class site_config::caching_resolver {
+
+ # Setup a conf.d directory to place additional unbound configuration files
+ # there must be at least one file in the directory, or unbound will not
+ # start, so create an empty placeholder to ensure this
+ file {
+ '/etc/unbound/conf.d':
+ ensure => directory,
+ owner => root, group => root, mode => '0755';
+
+ '/etc/unbound/conf.d/placeholder':
+ ensure => present,
+ content => '',
+ owner => root, group => root, mode => '0644';
+ }
+
+ class { 'unbound':
+ root_hints => false,
+ anchor => false,
+ ssl => false,
+ require => File['/etc/unbound/conf.d/placeholder'],
+ settings => {
+ server => {
+ verbosity => '1',
+ interface => [ '127.0.0.1', '::1' ],
+ port => '53',
+ hide-identity => 'yes',
+ hide-version => 'yes',
+ harden-glue => 'yes',
+ access-control => [ '127.0.0.0/8 allow', '::1 allow' ],
+ include => '/etc/unbound/conf.d/*'
+ }
+ }
+ }
+}