From 2369e44750aa17e0b29fc67ca85c89a29941fb99 Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Wed, 28 Jan 2015 10:55:34 -0800 Subject: [PATCH] Split out unbound as its own module Change-Id: I1182dfbd11abbaffbd736342a45aa1b85c775e8d --- modules.env | 1 + modules/unbound/files/dhclient.conf.debian | 9 --- modules/unbound/files/unbound.default | 18 ----- modules/unbound/manifests/init.pp | 85 ---------------------- 4 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 modules/unbound/files/dhclient.conf.debian delete mode 100644 modules/unbound/files/unbound.default delete mode 100644 modules/unbound/manifests/init.pp diff --git a/modules.env b/modules.env index e2bb2a4788..fb5f532fce 100644 --- a/modules.env +++ b/modules.env @@ -77,6 +77,7 @@ INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-openstacki INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-redis"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-drupal"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-mediawiki"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-unbound"]="origin/master" if [[ "$PUPPET_INTEGRATION_TEST" -ne "1" ]]; then # If puppet integration tests are not being run, merge SOURCE and INTEGRATION modules diff --git a/modules/unbound/files/dhclient.conf.debian b/modules/unbound/files/dhclient.conf.debian deleted file mode 100644 index c942598ee7..0000000000 --- a/modules/unbound/files/dhclient.conf.debian +++ /dev/null @@ -1,9 +0,0 @@ -option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; -send host-name ""; -request subnet-mask, broadcast-address, time-offset, routers, - domain-name, domain-name-servers, domain-search, host-name, - netbios-name-servers, netbios-scope, interface-mtu, - rfc3442-classless-static-routes, ntp-servers, - dhcp6.domain-search, dhcp6.fqdn, - dhcp6.name-servers, dhcp6.sntp-servers; -supersede domain-name-servers 127.0.0.1; diff --git a/modules/unbound/files/unbound.default b/modules/unbound/files/unbound.default deleted file mode 100644 index 784cb4c947..0000000000 --- a/modules/unbound/files/unbound.default +++ /dev/null @@ -1,18 +0,0 @@ -# If set, the unbound daemon will be started and stopped by the init script. -UNBOUND_ENABLE=true - -# Whether to automatically update the root trust anchor file. -ROOT_TRUST_ANCHOR_UPDATE=true - -# File in which to store the root trust anchor. -ROOT_TRUST_ANCHOR_FILE=/var/lib/unbound/root.key - -# If set, the unbound init script will provide unbound's listening -# IP addresses as nameservers to resolvconf. -RESOLVCONF=true - -# If set, resolvconf nameservers will be configured as forwarders -# to be used by unbound. -RESOLVCONF_FORWARDERS=false - -#DAEMON_OPTS="-c /etc/unbound/unbound.conf" diff --git a/modules/unbound/manifests/init.pp b/modules/unbound/manifests/init.pp deleted file mode 100644 index f5e3896202..0000000000 --- a/modules/unbound/manifests/init.pp +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2014 OpenStack Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# == Class: unbound - -# This installs unbound in its default configuration as a caching -# recursive resolver. - -class unbound ( - $install_resolv_conf = true -) { - - if ($::osfamily == 'Debian') { - # This file differs from that in the package only by setting - # RESOLVCONF_FORWARDERS to false. - file { '/etc/default/unbound': - source => 'puppet:///modules/unbound/unbound.default', - owner => 'root', - group => 'root', - mode => '0444', - } - - # We require the defaults file be in place before installing the - # package to work around this bug: - # https://bugs.launchpad.net/ubuntu/+source/unbound/+bug/988513 - # where we could end up briefly forwarding to a provider's broken - # DNS. - package { 'unbound': - ensure => present, - require => File['/etc/default/unbound'], - } - - # Tripleo uses dhcp - file { '/etc/dhcp/dhclient.conf': - source => 'puppet:///modules/unbound/dhclient.conf.debian', - owner => 'root', - group => 'root', - mode => '0444', - } - } - - # Ubuntu uses resolvconf which will update resolv.conf to point to - # localhost after unbound is installed. NOTE: Debian unknown. - if ($::osfamily == 'RedHat') { - package { 'unbound': - ensure => present, - } - - # HPCloud uses dhclient; tell dhclient to use our nameserver instead. - exec { '/usr/bin/printf "\nsupersede domain-name-servers 127.0.0.1;\n" >> /etc/dhcp/dhclient-eth0.conf': - unless => '/bin/grep -q "supersede domain-name-servers" /etc/dhcp/dhclient-eth0.conf' - } - } - - if ($install_resolv_conf) { - # Rackspace uses static config files - file { '/etc/resolv.conf': - content => "nameserver 127.0.0.1\n", - owner => 'root', - group => 'root', - mode => '0444', - require => Service['unbound'], - } - } - - service { 'unbound': - ensure => running, - name => 'unbound', - enable => true, - hasrestart => true, - hasstatus => false, - require => Package['unbound'], - } -}