Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

pdns (50) Versions 8.0.1

Installs/Configures PowerDNS Recursor and Authoritative server

Policyfile
Berkshelf
Knife
cookbook 'pdns', '= 8.0.1', :supermarket
cookbook 'pdns', '= 8.0.1'
knife supermarket install pdns
knife supermarket download pdns
README
Dependencies
Changelog
Quality -%

PowerDNS Community Cookbook

Provides resources for installing and configuring both PowerDNS authoritative and recursor. It uses the official PowerDNS repositories for packages and installs the appropriate configuration for your platform's init system.

Build Status

Build Status

Upgrade Notes for 8.x series

Please note that this version primarily supports PowerDNS 4.4 and PowerDNS Recursor 4.4. Older versions may work, but are not as heavily tested. Additionally support for Ubuntu 16.04 has been dropped.

When upgrading to the 8.x series, please note that virtual recursor instances now enforce the socket directory location for compatibility with the default systemd service unit.

Upgrade Notes for 7.x series

Please note that this version primarily supports PowerDNS 4.3 and PowerDNS Recursor 4.3. Older versions may work, but are not as heavily tested. Additionally support for CentOS 6 / sysvinit has been dropped.

When upgrading to the 7.x series, please pay special attention to your config and service resources which use the run_user / run_group / setuid / setgid properties. We have removed these attributes to better match the direction of upstream PowerDNS.

Upgrade Notes for 6.x series

When upgrading to the 6.x series, please pay special attention to your config and service resources which use the instance_name property. We have introduced a new virtual property to the config and service resources to more clearly mark them as a virtual instance versus the default one configured via the install resource. If you used instance_name '' to refer to the default instance, you can safely remove this property or leave it as-is. If you do use another name, then you will want to set virtual true in your config and service resources.

We have also changed the behavior of the socket_dir property on the service resources because it was incorrectly setup. It will be removed in a future release as it is a source of confusion (and bug) and a more advanced option for very specific use cases.

Ubuntu >=18.04 notes

Operating systems like Ubuntu 18.04 and greater that ship with systemd-resolved configured to run by default will need this disabled and to manually configure your resolv.conf if you are running PowerDNS Authoritative on default ports.
You can look at the test cookbook for a simple example of how to handle this.

Requirements

Platforms:

  • Ubuntu 18.04 and newer
  • Debian 9 and newer
  • RHEL 7 and newer
  • CentOS 7 and newer

Chef:

  • Chef 15 or newer

Init Systems:

  • systemd

Usage

Combine the different resources in order to install, configure, and manage your PowerDNS instances. This is a list of resouces that can be used:

| Resource | Functionality |
|-------------------------------------|---------------------------------------------------|
| pdns_authoritative_install | Installs an authoritative server |
| pdns_authoritative_config | Configures an authoritative instance |
| pdns_authoritative_service | Manages an authoritative instance |
| pdns_recursor_install | Installs a recusor |
| pdns_recursor_config | Configures a recursor instance  |
| pdns_recursor_service | Manages a a recursor instance |

To fully configure an authoritative server you need to add at least 3 resources to your recipe, pdns_authoritative_install, pdns_authoritative_config and pdns_authoritative_service. If you want to install any backend other than the default (bind) for the authoritative server you need to install the corresponding packages for the backend you want. There is an example for a postgresql backend in test/cookbooks/pdns_test/recipes/.

For a recursor use the pdns_recursor_install, pdns_recursor_config, and pdns_recursor_service resources in your wrapper cookbooks to install, configure, and define PowerDNS recursors. Set the different properties on the resources according to your install and configuration needs. You can see a good example of this in test/cookbooks/pdns_test/recipes_recursor_install_single.rb

For advanced use it is recommended to take a look at the chef resources themselves.

Properties

Virtual instances and instance name

If you wish to create multiple running copies of PowerDNS via Virtual Configurations you can set the virtual property on both the config and service resources. The name of the virtual instance will default to either the name of the resource or the 'instance_name' value of the resource if it is set. PowerDNS parses the name of the instance by breaking apart the first hyphen it sees so all virtual service names start with the service type and a hyphen. For example:

pdns_authoritative_config 'server_01' do
  virtual true
  launch ['gpgsql']
  variables(
    gpgsql_host: '127.0.0.1',
    gpgsql_user: 'pdns',
    gpgsql_port: 5432,
    gpgsql_dbname: 'pdns',
    gpgsql_password: 'wadus'
  )
  action :create
end

pdns_authoritative_service 'service_01' do
  virtual true
  action [:enable, :start]
end

Will create a file named /etc/powerdns/pdns-server_01.conf:

launch ['gpgsql']
gpgsql-host=127.0.0.1
gpgsql-user=pdns
gpgsql-port=5432
gpgsql-dbname=pdns
gpgsql-password=wadus

General note about resource properties

Most properties are simple ruby strings, but there are cases that require special attention.
Properties specified as elements in arrays will be split up (see split ruby method) and separated by commas.

Boolean properties will be always translated to 'yes' or 'no'.

Some properties need to be set consistently across resources, they will be noted in their specific sections at the top under 'Consistent?'.

Most of the properties are optional and have sane defaults, so they are only recommended for customized installs.

pdns_authoritative_install

Installs PowerDNS authoritative server 4.4.x series using PowerDNS official repository in the supported platforms.

Properties

Name Type Default value
version String ''
series String '44'
debug true, false false
allow_upgrade true, false false
backends Array nil

Note: When specifying backends, the name of the backend must match the repository package. For example, in Debian systems the Postgresql backend is actually named pgsql while on RHEL systems it is postgresql. Consider using the value_for_platform if you are installing on multiple platforms. There is an example of this technique in the test folder cookbook recipe.

Usage examples

Install the latest 4.4.x series PowerDNS Authoritative Server

pdns_authoritative_install 'server_01'

Install the latest 4.3.x series PowerDNS Authoritative Server

pdns_authoritative_install 'server_01' do
  series '43'
end

Install and upgrade to the latest 4.4.x PowerDNS Authoritative Server release

pdns_authoritative_install 'server_01' do
  series '43'
  allow_upgrade true
end

Install the latest 4.4.x series PowerDNS Authoritative Server with the MySQL and Lua backends

pdns_authoritative_install 'server_01' do
  series '44'
  backends ['mysql', 'lua']
end

pdns_authoritative_config

Creates a PowerDNS authoritative configuration, there is a fixed set of required properties (listed below) but most of the configuration is left to the user freely, every property set in the variables hash property will be rendered in the config template. Remember that using underscores _ for property names is required and it's translated to hyphens - in configuration templates.

Properties

Name Class Default value Consistent?
instance_name String name_property Yes
cookbook String,nil 'pdns' No
launch Array, nil ['bind'] No
config_dir String see default_authoritative_config_directory helper method Yes
socket_dir String "/var/run/#{resource.instance_name}" Yes
source String,nil 'authoritative.conf.erb' No
variables Hash { bind_config: "#{resource.config_dir}/bindbackend.conf" } No
virtual Boolean false No
  • cookbook : Cookbook for a custom configuration template.
  • launch : Backends to launch with the service.
  • config_dir : Path of the recursor configuration directory.
  • socket_dir : Directory where sockets are created.
  • source : Name of the recursor custom template.
  • variables: Variables for the configuration template.
  • virtual : Is this a virtual instance or the default?

Usage Example

Create a PowerDNS authoritative configuration file named server-01:

pdns_authoritative_config 'server_01' do
  virtual true
  launch ['gpgsql']
  variables(
    gpgsql_host: '127.0.0.1',
    gpgsql_user: 'pdns',
    gpgsql_port: 5432,
    gpgsql_dbname: 'pdns',
    gpgsql_password: 'wadus',
    allow_axfr_ips: [ '127.0.0.0/8', '::1', '195.234.23,34'],
    api: true,
    api-_eadonly: true
    )
  action :create
end

pdns_authoritative_service

Creates a service to manage a PowerDNS authoritative instance. This service supports all the regular actions (start, stop, restart, etc.). Check the compatibility section to see which init services are supported.

Important: services are not restarted or reloaded automatically on config changes in this cookbook, you need to add this in your wrapper cookbook if you desire this functionality, the pdns_authoritative_service cookbook provides actions to do it.

Properties

Name Class Default value Consistent?
instance_name String name_property Yes
config_dir String See default_authoritative_config_directory helper method Yes
virtual Boolean false No

Usage example

To enable and start the default PowerDNS Authoritative server

pdns_authoritative_service 'default' do
  action [:enable, :start]
end

To enable and start a virtual PowerDNS instance called 'server_01'

pdns_authoritative_service 'server_01' do
  virtual true
  action [:enable, :start]
end

pdns_recursor_install

Installs PowerDNS recursor 4.4.x series using PowerDNS official repository in the supported platforms.

Properties

Name Type Default value
version String ''
series String '44'
debug true, false false
allow_upgrade true, false false

Usage examples

Install the latest 4.4.x release PowerDNS recursor

pdns_recursor_install 'latest_4_3_x_recursor'

Install the latest 4.3.x release PowerDNS recursor

pdns_recursor_install 'my_recursor' do
  series '43'
end

Install and upgrade to the latest 4.4.x PowerDNS recursor release

pdns_recursor_install 'my_recursor' do
  series '44'
  allow_upgrade true
end

pdns_recursor_config

Creates a PowerDNS recursor configuration.

Properties

Name Class Default value Consistent?
instance_name String name_property Yes
cookbook String,nil 'pdns' No
config_dir String see default_recursor_config_directory helper method Yes
socket_dir String "/var/run/#{resource.instance_name}" Yes
source String,nil 'recursor.conf.erb' No
variables Hash {} No
virtual Boolean false No
  • cookbook : Cookbook for a custom configuration template.
  • config_dir : Path of the recursor configuration directory.
  • socket_dir : Directory where sockets are created.
  • source : Name of the recursor custom template.
  • variables: Variables for the configuration template.
  • virtual : Is this a virtual instance or the default?

pdns_recursor_service

Sets up a PowerDNS recursor instance.

Important: services not restarted or reloaded automatically on config changes in this cookbook, you need to add this in your wrapper cookbook if you desire this functionality, the pdns_recursor_service cookbook provides actions to do it.

Properties

Name Class Default value Consistent?
instance_name String name_property Yes
config_dir String See default_recursor_config_directory helper method Yes
virtual Boolean false No

Usage Example

Disable the default PowerDNS recursor install service

pdns_recursor_service 'default' do
  action [:disable, :stop]
end

Configure a virtual PowerDNS recursor service instance named 'my_recursor' in your wrapper cookbook for Acme Corp with a custom template named my-recursor.erb

pdns_recursor_service 'my_recursor' do
  virtual true
  source 'my-recursor.erb'
  cookbook 'acme-pdns-recursor'
end

Usage Example

Customize the default recursor installation and change it's port to 54:

pdns_recursor_config 'default' do
  variables(
    'local-port' => '54'
  )
end

Create a PowerDNS recursor configuration named 'my_recursor' in your wrapper cookbook for Acme Corp which uses a custom template named my-recursor.erb and a few attributes:

pdns_recursor_config 'my_recursor' do
  virtual true
  source 'my-recursor.erb'
  cookbook 'acme-pdns-recursor'
  variables(client-tcp-timeout: '20', loglevel: '5', network-timeout: '2000')
end

Virtual Hosting

PowerDNS supports virtual hosting: running many instances of PowerDNS on different ports on the same machine. This cookbook leverages this functionality in both recursor and authoritative. For recursor virtual hosts, the socket directory is strictly enforced to support the default systemd service unit.

Contributing

There is an specific file for contributing guidelines on this cookbook: CONTRIBUTING.md

Testing

There is an specific file for testing guidelines on this cookbook: TESTING.md

License

Copyright (c) 2010-2014, Chef Software, Inc
Copyright (c) 2014-2021, DNSimple Corporation

Licensed under the Apache License, Version 2.0.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Changelog

v8.0.1 (2021-02-22)

Full Changelog

Fixed bugs:

  • Getting an error if I do not stop pdns service #88
  • issue in running the test recipe #83
  • pdns_authoritative_backend matchers should be named install_pdns_authoritative_backend #68
  • Add DNF / CentOS 8 - drop CentOS 6 #112 (sspans)

Closed issues:

  • RHEL / CentOS 8 needs work #111
  • Depfu Error: No dependency files found #109
  • CentOS 7: Cookbook doesn't upgrade pdns-recursor previously installed from EPEL Repo #65
  • CentOS 7 Support #64

Merged pull requests:

v6.1.1 (2018-12-08)

Full Changelog

Merged pull requests:

v6.1.0 (2018-12-08)

Full Changelog

Implemented enhancements:

  • Add modules to the install resources #104
  • Add backends option to Authoritative Installation resources #105 (martinisoft)

v6.0.0 (2018-12-06)

Full Changelog

Merged pull requests:

v5.0.0 (2018-11-27)

Full Changelog

Implemented enhancements:

  • add an upgrade action to the recursor_install_rhel resource. #84 (MattMencel)

Merged pull requests:

v4.4.0 (2018-03-09)

Full Changelog

Implemented enhancements:

Fixed bugs:

v4.3.1 (2018-03-08)

Full Changelog

Fixed bugs:

  • Fix: converge suite authoritative-postgres-centos-6 #63

Closed issues:

  • Fix Testing #91
  • Configuration permissions issues #89

Merged pull requests:

v4.3.0 (2017-08-16)

Full Changelog

Fixed bugs:

v4.2.0 (2017-08-16)

Full Changelog

Merged pull requests:

v4.1.0 (2017-08-09)

Full Changelog

Closed issues:

  • Allow users to be appended to the pdns unix group #81
  • Drop apt and yum cookbooks #59

v4.0.0 (2017-08-04)

Full Changelog

Implemented enhancements:

  • Refactor resources to match packaging configurations #80 (therobot)

Closed issues:

  • Add Systemd support #58

v3.5.0 (2017-07-13)

Full Changelog

Merged pull requests:

  • Add systemd support for recursor and authoritative PowerDNS #66 (jmauro)

v3.4.1 (2017-06-29)

Full Changelog

Closed issues:

  • pdns_recursor_service_sysvinit behaves different when using Vagrant or Docker as providers #77
  • Recursor refuses to start with custom socket-dir setting #74

Merged pull requests:

  • Stopping default recursor on debian based distros for sysvinit #78 (therobot)
  • Removing DB schema #76 (therobot)

v3.4.0 (2017-06-27)

Full Changelog

Merged pull requests:

v3.3.2 (2017-06-23)

Full Changelog

Fixed bugs:

Merged pull requests:

  • Create PID directory on init start commands #75 (therobot)

v3.3.1 (2017-06-20)

Full Changelog

Merged pull requests:

v3.3.0 (2017-06-14)

Full Changelog

Merged pull requests:

v3.2.0 (2017-06-02)

Full Changelog

Implemented enhancements:

v3.1.0 (2017-06-01)

Full Changelog

Merged pull requests:

v3.0.0 (2017-05-29)

Full Changelog

Implemented enhancements:

  • Improving the way configuration options are handled #24
  • Authoritative Resource #49 (therobot)
  • PowerDNS recursor using Chef 12.5+ resource #48 (therobot)

Fixed bugs:

  • Missing libssl-dev on source installs #44

Closed issues:

  • Add tests for multi recursor-multi #60
  • Add integration test for multi suits #57
  • Virtual hosting for recursor #55
  • Rename cookbook repository and update metadata/README #47
  • Sunset Chef 10.x and possibly 11.x support? #28
  • Switch to bind for the default backend #23
  • converge will fail on centos 6.5 #18
  • Refactor the use of mysql::client #15

Merged pull requests:

v2.5.0 (2017-02-08)

Full Changelog

Merged pull requests:

v2.4.1 (2016-09-14)

Full Changelog

Merged pull requests:

v2.4.0 (2016-09-13)

Full Changelog

Merged pull requests:

  • Change to make the cookbook compatible with CentOS/RHEL #36 (stromp)

v2.3.0 (2016-09-09)

Full Changelog

Closed issues:

  • Bootstrapping fails #35

Merged pull requests:

v2.2.1 (2016-03-04)

Full Changelog

v2.2.0 (2016-03-04)

Full Changelog

v2.1.1 (2016-03-04)

Full Changelog

Closed issues:

  • No pdns-server package #33

v2.1.0 (2016-01-11)

Full Changelog

Merged pull requests:

  • Minimal support for a authoritative bind backend #32 (therobot)

v2.0.0 (2016-01-04)

Full Changelog

Merged pull requests:

  • Building a recursor from source and major cleanup #31 (therobot)

v1.1.1 (2015-12-23)

Full Changelog

Merged pull requests:

  • Cleanup, bug fixes and small improvements. #30 (therobot)

v1.1.0 (2015-12-10)

Full Changelog

Merged pull requests:

  • Code refactor and added functionalities #25 (therobot)

v1.0.5 (2015-11-10)

Full Changelog

v1.0.4 (2015-09-02)

Full Changelog

v1.0.3 (2015-05-04)

Full Changelog

v1.0.2 (2015-05-04)

Full Changelog

Merged pull requests:

v1.0.1 (2014-12-17)

Full Changelog

v1.0.0 (2014-12-15)

Full Changelog

Merged pull requests:

v0.3.4 (2014-07-15)

Full Changelog

Merged pull requests:

v0.3.3 (2014-07-14)

Full Changelog

v0.3.2 (2014-07-14)

Full Changelog

Merged pull requests:

v0.3.0 (2014-02-21)

Full Changelog

v0.2.0 (2013-08-28)

Full Changelog

Merged pull requests:

  • [COOK-3106] Build PowerDNS from source #8 (dje)

0.1.2 (2013-05-28)

Full Changelog

Merged pull requests:

  • [COOK-2986] Fix foodcritic warnings #7 (stevendanna)
  • [COOK-2604] Configure a PowerDNS server #2 (dje)

* This Changelog was automatically generated by github_changelog_generator

No quality metric results found