Puppet powerdns module
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with powerdns
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Authors - Who is contributing to do it
- License
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
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.
-
Debian Family:
- Packages [ 'pdns-backend-geo', 'pdns-backend-ldap', 'pdns-backend-lua', 'pdns-backend-mysql', 'pdns-backend-pgsql', 'pdns-backend-pipe', 'pdns-backend-sqlite3' ]
- Files [ '/etc/powerdns/bindbackend.conf', '/etc/powerdns/pdns.d/pdns.simplebind.conf', '/etc/powerdns/pdns.d/pdns.local.conf', ]
- Services [ 'pdns' ]
-
RedHat Family
- 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' ]
- Files [ '/etc/pdns/bindbackend.conf', '/etc/pdns/pdns.d/pdns.simplebind.conf', '/etc/pdns/pdns.d/pdns.local.conf' ]
- Services [ 'pdns-recursor' ]
-
Is very important to know about PowerDNS to use this Puppet module.
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.
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-recursion' => '127.0.0.1',
'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',
}
}
}
- Puppet
- PowerDNS
- Rubocop
- rspec-puppet
- puppet-blacksmith
- RSpec For Ops Part 2: Diving in with rspec-puppet
- 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.
- 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.
You can also support my work on powerdns via
This module is released under the GNU General Public License Version 3: