powerdns

PowerDNS provisioner Module

Christian Gonzalez Di Antonio

christiangda

11,421 downloads

6,669 latest version

5.0 quality score

Version information

  • 1.0.3 (latest)
  • 1.0.1
  • 0.0.8
  • 0.0.7
  • 0.0.5
  • 0.0.3
  • 0.0.1
released Mar 5th 2017
This version is compatible with:
  • Puppet Enterprise 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.8.0
  • RedHat
    ,
    Debian

Start using this module

Documentation

christiangda/powerdns — version 1.0.3 Mar 5th 2017

Puppet powerdns module

Build Status Code Climate Test Coverage Issue Count Puppet Forge Puppet Forge Downloads

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with powerdns
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module
  8. Authors - Who is contributing to do it
  9. License

Overview

This is a Puppet module to manage PowerDNS tool. With this module you can installs, configures, and manages the PowerDNS services.

This module were designed to work with Puppet version >= 3.8.0

Module Description

PowerDNS consists of two parts: the Authoritative Server and the Recursor, and you can use this module to configure both. For both PowerDNS operation modes, you could install, configure and manage the services, is very easy used this to configure your PowerDNS, in fact, you have predefined configuration values to put and run.

Setup

What ::powerdns affects

  • Debian Family:

    1. Packages [ 'pdns-backend-geo', 'pdns-backend-ldap', 'pdns-backend-lua', 'pdns-backend-mysql', 'pdns-backend-pgsql', 'pdns-backend-pipe', 'pdns-backend-sqlite3' ]
    2. Files [ '/etc/powerdns/bindbackend.conf', '/etc/powerdns/pdns.d/pdns.simplebind.conf', '/etc/powerdns/pdns.d/pdns.local.conf', ]
    3. Services [ 'pdns' ]
  • RedHat Family

    1. Packages [ 'pdns-backend-geo', 'pdns-backend-lua', 'pdns-backend-ldap', 'pdns-backend-lmdb', 'pdns-backend-pipe', 'pdns-backend-geoip', 'pdns-backend-mydns', 'pdns-backend-mysql', 'pdns-backend-remote', 'pdns-backend-sqlite', 'pdns-backend-opendbx', 'pdns-backend-tinydns', 'pdns-backend-postgresql' ]
    2. Files [ '/etc/pdns/bindbackend.conf', '/etc/pdns/pdns.d/pdns.simplebind.conf', '/etc/pdns/pdns.d/pdns.local.conf' ]
    3. Services [ 'pdns-recursor' ]
  • Is very important to know about PowerDNS to use this Puppet module.

Beginning with ::powerdns

You can use

node 'dns.mynetwork.local' {
  include ::powerdns
  include ::powerdns::backend
}

or

node 'dns.mynetwork.local' {
  class { '::powerdns': }
  class { '::powerdns::backend': }
}

to install and configure PowerDNS with Default module parameters.

additional you could use

node 'dns.mynetwork.local' {
  include ::powerdns::recursor
}

or

node 'dns.mynetwork.local' {
  class { '::powerdns::recursor': }
}

if you want to configure PowerDNS Recursor service.

Usage

For more specific configuration of powerdns class you can use:

node 'dns.mynetwork.local' {
  class { '::powerdns':
    package_ensure     => 'present',
    service_enable     => true,
    service_ensure     => 'running',
    service_status     => true,
    service_status_cmd => '/usr/bin/pdns_control ping 2>/dev/null 1>/dev/null',
    config => {
      'allow-from'      => '192.168.1.0/24',
      'local-port'      => 53,
      'query-cache-ttl' => 20,
    }
  }
}

To configure PostgreSQL as backend, you can do: NOTE: See valid backend name in param file before to set variable backend_name this depend of the Operating System type

node 'dns.mynetwork.local' {
  class { '::powerdns::backend':
    backend_name => 'pgsql',
    ensure       => 'present',
    config       => {
      'launch'          => 'gpgsql',
      'gpgsql-host'     => 'localhost',
      'gpgsql-port'     => '3306',
      'gpgsql-dbname'   => 'mypdnsdb',
      'gpgsql-user'     => 'mypdnsuser',
      'gpgsql-password' => 'mypassword',
    }
  }
}

For more specific configuration of PowerDNS Recursor class you can use:

node 'dns.mynetwork.local' {
  class { '::powerdns::recursor':
    package_ensure     => 'present',
    service_enable     => true,
    service_ensure     => 'running',
    service_status     => true,
    service_status_cmd => '/usr/bin/rec_control ping 2>/dev/null 1>/dev/null',
    config => {
      'allow-from'                 => '192.168.1.0/24',
      'local-port'                 => 53,
      'etc-hosts-file'             => '/etc/hosts',
    }
  }
}

Reference

Limitations

  • This module could not manage DNS records, this only can be used as configuration of PowerDNS.
  • If you change backend type, it doesn't remove your old backend file config from the /etc/[pdns|powerdns]/pdns.d/pdns.local.[backend type].conf, so is neccesay that you remove it after change the backend type to use the new backend.

Development / contributing

  • Fork it / Clone it (git clone https://github.com/christiangda/puppet-powerdns.git; cd puppet-powerdns)
  • Create your feature branch (git checkout -b my-new-feature)
  • Install rvm
  • Install ruby rvm install 2.3
  • Install ruby rvm usage ruby-2.3.3 in my case
  • Install bundler app first (gem install bundler)
  • Install rubygems dependecies in .vendor folder (bundle install --path .vendor)
  • Make your changes / improvements / fixes / etc, and of course your Unit Test for new code
  • Run the tests (bundle exec rake test)
  • Commit your changes (git add . && git commit -m 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Of course, bug reports and suggestions for improvements are always welcome. GitHub pull requests are even better! :-)

You can also support my work on powerdns via

Donate

Support via Gratipay

Authors

License

This module is released under the GNU General Public License Version 3: