Forge Home

powerdns

PowerDNS provisioner Module

12,802 downloads

7,607 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.3 (latest)
  • 1.0.1
  • 0.0.8 (deleted)
  • 0.0.7
  • 0.0.5
  • 0.0.3
  • 0.0.1
released Mar 5th 2017
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 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
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'christiangda-powerdns', '1.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add christiangda-powerdns
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install christiangda-powerdns --version 1.0.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

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: