diff --git a/.travis.yml b/.travis.yml index beb90d2..0779a16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,20 +17,20 @@ env: - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-centos-8 - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-debian-9 - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-debian-10 - - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-ubuntu-1604 - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-ubuntu-1804 + - TASK="kitchen" KITCHEN_REGEXP=authoritative-multi-ubuntu-2004 - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-centos-7 - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-centos-8 - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-debian-9 - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-debian-10 - # - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-ubuntu-1604 # https://askubuntu.com/questions/830346/postgresql-server-doesnt-start - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-ubuntu-1804 + - TASK="kitchen" KITCHEN_REGEXP=authoritative-postgres-ubuntu-2004 - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-centos-7 - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-centos-8 - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-debian-9 - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-debian-10 - - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-ubuntu-1604 - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-ubuntu-1804 + - TASK="kitchen" KITCHEN_REGEXP=recursor-multi-ubuntu-2004 matrix: fast_finish: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5de4f6..0f7d73e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,11 +4,11 @@ We're excited that you'd like to help us with our PowerDNS cookbook project! ## Submitting issues -When submitting an issue, please check the Issues section of this repository on Github to make sure it has not already been reported. If it has been reported, then please contribute to the conversation on the issue and provide any additional information you can. If it has not been reported, please be as detailed as possible. +When submitting an issue, please check the [Issues](https://github.com/dnsimple/chef-pdns/issues) section of this repository on Github to make sure it has not already been reported. If it has been reported, then please contribute to the conversation on the issue and provide any additional information you can. If it has not been reported, please be as detailed as possible. ## Contribution process -1. Fork the repository to your own account if you have not yet done do already. +1. Fork the repository into your own account if you have not done so already. 2. Commit changes to a git branch that is named after the changes you wish to contribute. 3. Create a GitHub Pull Request for your change, following the [Pull Request Requirements](#pull-request-requirements) 4. Perform a [Code Review](#code-review-process) with the cookbook maintainers on the pull request. @@ -18,7 +18,7 @@ When submitting an issue, please check the Issues section of this repository on In order to maintain a high standard of compatibility and consistency for the consumers of our cookbook we like to make sure all pull requests meet the following criteria: 1. **Tests:** To ensure high quality code and protect against regressions in the future we require all changes have ample test coverage. This does not mean 100% coverage or even specific types of coverage. See the TESTING.md file for details on how to run the test suite. -2. **Passing Continuous Integration (CI):** Speaking of tests, the contributed code must pass our full suite of tests on [Travis-CI][] and show a green indicator meaning the latest build passes. If for some reason the build is failing before your pull request please raise the issue in the pull request so we may address it. +2. **Passing Continuous Integration (CI):** Speaking of tests, the contributed code must pass our full suite of tests on [Travis-CI](https://travis-ci.com/github/dnsimple/chef-pdns) and show a green indicator meaning the latest build passes. If for some reason the build is failing before your pull request, please raise the issue in the pull request so we may address it. ### Code Review Process @@ -32,8 +32,8 @@ Once you open a pull request, cookbook maintainers will review your code using t ## Contribution Guidelines * **DO** include tests in your pull requests where applicable -* **DONT** modify or change the version number in the metadata.rb as we prefer to control the release cycle ourselves and it makes for code merging headaches that make everyone involved pretty sad -* **DONT** modify the CHANGELOG.md in your pull request as well. The maintainers will auto-generate this before a new release. +* **DONT** modify or change the version number in the `metadata.rb` as we prefer to control the release cycle ourselves and it makes for code merging headaches that make everyone involved pretty sad +* **DONT** modify the `CHANGELOG.md` in your pull request as well. The maintainers will auto-generate this before a new release. * **DO** remember that humans are handling your contributions so please be nice and polite when discussing anything in your pull request. [security page]: https://dnsimple.com/security diff --git a/README.md b/README.md index 716478f..8a3b36b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,19 @@ # 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 appropiate configuration for your platform's init system. +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](https://travis-ci.org/dnsimple/chef-pdns.svg?branch=master)](https://travis-ci.org/dnsimple/chef-pdns) +[![Build Status](https://travis-ci.org/dnsimple/chef-pdns.svg?branch=main)](https://travis-ci.org/dnsimple/chef-pdns) + +## 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. @@ -26,14 +33,14 @@ You can look at the [test cookbook](https://github.com/dnsimple/chef-pdns/blob/m ### Platforms: -- Ubuntu 14.04 and newer -- Debian 8 and newer +- Ubuntu 18.04 and newer +- Debian 9 and newer - RHEL 7 and newer - CentOS 7 and newer ### Chef: -- Chef 13 or newer +- Chef 15 or newer ### Init Systems: @@ -95,82 +102,91 @@ gpgsql-dbname=pdns gpgsql-password=wadus ``` -And a service named `pdns-server_01` which is symbolically linked linked to `pdns` if you are using SysVinit. - #### General note about resource properties -Most properties are simple ruby strings, but there is another cases that require special attention. +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 accross resources, they will be noted in their specific sections at the top under 'Consistent?'. + +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.3.x series using PowerDNS official repository in the supported platforms. +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 | '43' | +| series | String | '44' | | debug | true, false | false | | allow_upgrade | true, false | false | | backends | Array | nil | -**Note:** When specifying the 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. +**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.3.x series PowerDNS Authoritative Server +Install the latest 4.4.x series PowerDNS Authoritative Server ```ruby pdns_authoritative_install 'server_01' ``` -Install the latest 4.2.x series PowerDNS Authoritative Server +Install the latest 4.3.x series PowerDNS Authoritative Server ```ruby pdns_authoritative_install 'server_01' do - series '42' + series '43' end ``` -Install and upgrade to the latest 4.0.x PowerDNS Authoritative Server release +Install and upgrade to the latest 4.4.x PowerDNS Authoritative Server release ```ruby pdns_authoritative_install 'server_01' do - series '40' + series '43' allow_upgrade true end ``` -Install the latest 4.1.x series PowerDNS Authoritative Server with the MySQL and Lua backends +Install the latest 4.4.x series PowerDNS Authoritative Server with the MySQL and Lua backends ```ruby pdns_authoritative_install 'server_01' do - series '41' + series '44' backends ['mysql', 'lua'] end ``` ### pdns_authoritative_config -Creates a PowerDNS recursor 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. +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 | -| virtual | Boolean | false | 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_service.conf.erb' | No | -| cookbook | String,nil | 'pdns' | No | -| variables | Hash | { bind_config: "#{resource.config_dir}/bindbackend.conf" } | No | +| 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 @@ -205,12 +221,8 @@ Creates a service to manage a PowerDNS authoritative instance. This service supp | Name | Class | Default value | Consistent? | |----------------|-------------|------------------------------------------------------------|-------------| | instance_name | String | name_property | Yes | -| virtual | Boolean | false | No | -| cookbook | String | 'pdns' | No | -| source | String | 'authoritative.init.debian.erb' | No | | config_dir | String | See `default_authoritative_config_directory` helper method | Yes | -| socket_dir | String | "/var/run/#{instance_name}" | Yes | -| variables | Hash | {} | No | +| virtual | Boolean | false | No | #### Usage example @@ -233,64 +245,79 @@ end ### pdns_recursor_install -Installs PowerDNS recursor 4.3.x series using PowerDNS official repository in the supported platforms. +Installs PowerDNS recursor 4.4.x series using PowerDNS official repository in the supported platforms. #### Properties | Name | Type | Default value | |----------------|-------------|-----------------| | version | String | '' | -| series | String | '43' | +| series | String | '44' | | debug | true, false | false | | allow_upgrade | true, false | false | #### Usage examples -Install the latest 4.3.x release PowerDNS recursor +Install the latest 4.4.x release PowerDNS recursor ```ruby pdns_recursor_install 'latest_4_3_x_recursor' ``` -Install the latest 4.2.x release PowerDNS recursor +Install the latest 4.3.x release PowerDNS recursor ```ruby pdns_recursor_install 'my_recursor' do - series '42' + series '43' end ``` -Install and upgrade to the latest 4.0.x PowerDNS recursor release +Install and upgrade to the latest 4.4.x PowerDNS recursor release ```ruby pdns_recursor_install 'my_recursor' do - series '40' + 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 using the appropiate init system . +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 | -|--------------------------|------------|-------------------------------------------------------| -| instance_name | String | Resource name | -| virtual | Boolean | false | -| config_dir | String | see `default_recursor_config_directory` helper method | -| cookbook (SysVinit) | String,nil | 'pdns' | -| source (SysVinit) | String,nil | 'recursor.init.#{node['platform_family']}.erb' | -| variables (SysVinit) | Hash | {} | - -- `config_dir`: Path of the recursor configuration directory. -- `cookbook`: Cookbook for a custom configuration template (Applied only when using SysVinit). -- `source`: Name of the recursor custom template (Applied only when using SysVinit). -- `variables`: Variables hash to pass to the sysvinit template +| 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 @@ -312,30 +339,6 @@ pdns_recursor_service 'my_recursor' do end ``` -### pdns_recursor_config - -Creates a PowerDNS recursor configuration. - -#### Properties - -| Name | Class | Default value | -|----------------|-------------|--------------------------------------------------------| -| instance_name | String | Resource name | -| virtual | Boolean | false | -| config_dir | String | see `default_recursor_config_directory` helper method | -| socket_dir | String | /var/run/#{resource.instance_name} | -| source | String, nil | 'recursor_service.conf.erb' | -| cookbook | String, nil | 'pdns' | -| variables | Hash | {} | - -- `virtual` : Is this a virtual instance or the default? -- `config_dir` : Path of the recursor configuration directory. -- `socket_dir` : Directory where sockets are created. -- `source` : Name of the recursor custom template. -- `socket_dir` : Directory where sockets are created. -- `cookbook` : Cookbook for a custom configuration template -- `variables`: Variables for the configuration template. - #### Usage Example Customize the default recursor installation and change it's port to 54: @@ -361,24 +364,19 @@ end #### Virtual Hosting -PowerDNS supports virtual hosting: running many instances of PowerDNS on different ports on the same machine. This is done by a few clever hacks on the init scripts that allow to specify different config files for each instance. This cookbook leverages this functionality in both recursor and authoritative. - -[PowerDNS recommends a specific naming schema](https://doc.powerdns.com/md/authoritative/running/) authoritative for virtual hosting. Specifically it does not allow hyphens (-) on the init scripts beyond the first which is provided by the init script (`/etc/init.d/pdns-`). - -We have adopted the convention of using underscores (_) in the name attributes of underscores in order to comply with this requirement. +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 cokbook: CONTRIBUTING.md +There is an specific file for contributing guidelines on this cookbook: CONTRIBUTING.md ## Testing -There is an specific file for testing guidelines on this cokbook: TESTING.md - +There is an specific file for testing guidelines on this cookbook: TESTING.md ## License Copyright (c) 2010-2014, Chef Software, Inc -Copyright (c) 2014-2020, DNSimple Corporation +Copyright (c) 2014-2021, DNSimple Corporation Licensed under the Apache License, Version 2.0. diff --git a/TESTING.md b/TESTING.md index 0f7e401..84c7e2c 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,22 +1,17 @@ # Testing -To run the tests across all platforms, you want to grab the latest [ChefDK][https://downloads.chef.io/chefdk], -install [VirtualBox][http://virtualbox.org], and, [Vagrant][https://www.vagrantup.com]: +To run the tests across all platforms, you want to grab the latest [ChefDK](https://downloads.chef.io/tools/chefdk])or [Chef-Workstation](https://downloads.chef.io/tools/workstation) and [Docker](https://docs.docker.com/get-docker/): -We currenty use Rubocop, Foodcritic, ChefSpec and Inspec tests. +We currently use Cookstyle, ChefSpec and Inspec tests. -## Rubocop, Foodcritic, and ChefSpec +## ChefSpec and Cookstyle -We provide a Rakefile with shortcuts for running our tests. +We provide a `Rakefile` with shortcuts for running our tests. -Run : `chef exec rake style:rubocop` for rubocop tests. -Run : `chef exec rake style:foodcritic` for foodcritic tests. -Run: `chef exec rake style` for both style tests. -Run: `chef exec rake unit` for unit tests. -Run: `chef exec rake quick` for unit and style tests. +Run: `chef exec rake` for all tests. +Run: `chef exec rake kitchen` for kitchen tests. +Run: `chef exec rake quick` for unit and style tests. ## Test-Kitchen and Inspec -Run: `chef exec kitchen list` to get a list of suites and platforms then `chef exec kitchen verify ` to verify a specific platform. - - +Run: `chef exec kitchen list` to get a list of suites and platforms then `chef exec kitchen test ` to build and verify a specific platform. diff --git a/.kitchen.yml b/kitchen.yml similarity index 85% rename from .kitchen.yml rename to kitchen.yml index d229893..41e44af 100644 --- a/.kitchen.yml +++ b/kitchen.yml @@ -1,7 +1,7 @@ --- driver: name: dokken - chef_version: 15 + chef_version: 16 privileged: true transport: @@ -10,12 +10,6 @@ transport: provisioner: name: dokken chef_license: accept - # On CentOS 6, restart the 'postgres' database could fail the first time so - # let's try twice before failing: - # https://github.com/sous-chefs/postgresql/issues/421 - retry_on_exit_code: - - 1 - max_retries: 2 verifier: name: inspec @@ -47,17 +41,17 @@ platforms: - RUN /usr/bin/apt-get update - RUN /usr/bin/apt-get install dnsutils -y - - name: ubuntu-16.04 + - name: ubuntu-18.04 driver: - image: dokken/ubuntu-16.04 + image: dokken/ubuntu-18.04 pid_one_command: /bin/systemd intermediate_instructions: - RUN /usr/bin/apt-get update - RUN /usr/bin/apt-get install dnsutils -y - - name: ubuntu-18.04 + - name: ubuntu-20.04 driver: - image: dokken/ubuntu-18.04 + image: dokken/ubuntu-20.04 pid_one_command: /bin/systemd intermediate_instructions: - RUN /usr/bin/apt-get update diff --git a/libraries/helpers.rb b/libraries/helpers.rb index e032d57..ba6e98f 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -55,6 +55,10 @@ def default_recursor_config_directory end end + def recursor_socket_directory(name, socket_dir, virtual) + virtual ? "/var/run/pdns-recursor-#{name}" : socket_dir + end + def recursor_instance_config(name, virtual) virtual ? "recursor-#{name}.conf" : 'recursor.conf' end diff --git a/metadata.rb b/metadata.rb index 04438e4..2953f2b 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,9 +7,9 @@ source_url 'https://github.com/dnsimple/chef-pdns' issues_url 'https://github.com/dnsimple/chef-pdns/issues' -chef_version '>= 13' +chef_version '>= 15' -supports 'ubuntu', '>= 16.04' +supports 'ubuntu', '>= 18.04' supports 'debian', '>= 9.0' supports 'centos', '>= 7.0' supports 'redhat', '>= 7.0' diff --git a/resources/authoritative_config.rb b/resources/authoritative_config.rb index a9d0e2b..80c113e 100644 --- a/resources/authoritative_config.rb +++ b/resources/authoritative_config.rb @@ -18,7 +18,7 @@ # provides :pdns_authoritative_config, platform: 'ubuntu' do |node| - node['platform_version'].to_f >= 16.04 + node['platform_version'].to_f >= 18.04 end provides :pdns_authoritative_config, platform: 'debian' do |node| @@ -26,7 +26,7 @@ end provides :pdns_authoritative_config, platform_family: 'rhel' do |node| - node['platform_version'].to_i >= 6 + node['platform_version'].to_i >= 7 end include Pdns::AuthoritativeHelpers @@ -39,7 +39,7 @@ property :config_dir, String, default: lazy { default_authoritative_config_directory } property :socket_dir, String, default: '/var/run/pdns' -property :source, String, default: 'authoritative_service.conf.erb' +property :source, String, default: 'authoritative.conf.erb' property :cookbook, String, default: 'pdns' property :variables, Hash, default: lazy { |resource| { bind_config: "#{resource.config_dir}/bindbackend.conf" } } diff --git a/resources/authoritative_install_debian.rb b/resources/authoritative_install_debian.rb index 4ef4c2b..bbe2eba 100644 --- a/resources/authoritative_install_debian.rb +++ b/resources/authoritative_install_debian.rb @@ -18,7 +18,7 @@ # provides :pdns_authoritative_install, platform: 'ubuntu' do |node| - node['platform_version'].to_f >= 16.04 + node['platform_version'].to_f >= 18.04 end provides :pdns_authoritative_install, platform: 'debian' do |node| @@ -26,7 +26,7 @@ end property :version, String -property :series, String, default: '43' +property :series, String, default: '44' property :debug, [true, false], default: false property :allow_upgrade, [true, false], default: false property :backends, Array diff --git a/resources/authoritative_install_rhel.rb b/resources/authoritative_install_rhel.rb index 713b001..20522fb 100644 --- a/resources/authoritative_install_rhel.rb +++ b/resources/authoritative_install_rhel.rb @@ -22,7 +22,7 @@ end property :version, String -property :series, String, default: '43' +property :series, String, default: '44' property :debug, [true, false], default: false property :allow_upgrade, [true, false], default: false property :backends, Array diff --git a/resources/recursor_config.rb b/resources/recursor_config.rb index cb24a28..c76b4f1 100644 --- a/resources/recursor_config.rb +++ b/resources/recursor_config.rb @@ -18,7 +18,7 @@ # provides :pdns_recursor_config, platform: 'ubuntu' do |node| - node['platform_version'].to_f >= 16.04 + node['platform_version'].to_f >= 18.04 end provides :pdns_recursor_config, platform: 'debian' do |node| @@ -26,7 +26,7 @@ end provides :pdns_recursor_config, platform_family: 'rhel' do |node| - node['platform_version'].to_i >= 6 + node['platform_version'].to_i >= 7 end include Pdns::RecursorHelpers @@ -38,7 +38,7 @@ property :config_dir, String, default: lazy { default_recursor_config_directory } property :socket_dir, String, default: '/var/run/pdns-recursor' -property :source, String, default: 'recursor_service.conf.erb' +property :source, String, default: 'recursor.conf.erb' property :cookbook, String, default: 'pdns' property :variables, Hash, default: {} @@ -73,7 +73,7 @@ group lazy { default_recursor_run_user } mode '0640' variables( - socket_dir: new_resource.socket_dir, + socket_dir: "#{recursor_socket_directory(new_resource.instance_name, new_resource.socket_dir, new_resource.virtual)}", variables: new_resource.variables ) end diff --git a/resources/recursor_install_debian.rb b/resources/recursor_install_debian.rb index 2266f65..ed61383 100644 --- a/resources/recursor_install_debian.rb +++ b/resources/recursor_install_debian.rb @@ -18,14 +18,14 @@ # provides :pdns_recursor_install, platform: 'ubuntu' do |node| - node['platform_version'].to_f >= 16.04 + node['platform_version'].to_f >= 18.04 end provides :pdns_recursor_install, platform: 'debian' do |node| node['platform_version'].to_i >= 9 end -property :series, String, default: '43' +property :series, String, default: '44' property :version, String property :debug, [true, false], default: false property :allow_upgrade, [true, false], default: false diff --git a/resources/recursor_install_rhel.rb b/resources/recursor_install_rhel.rb index 6f8346a..f268829 100644 --- a/resources/recursor_install_rhel.rb +++ b/resources/recursor_install_rhel.rb @@ -22,7 +22,7 @@ end property :version, String -property :series, String, default: '43' +property :series, String, default: '44' property :debug, [true, false], default: false property :allow_upgrade, [true, false], default: false diff --git a/templates/default/authoritative_service.conf.erb b/templates/default/authoritative.conf.erb similarity index 100% rename from templates/default/authoritative_service.conf.erb rename to templates/default/authoritative.conf.erb diff --git a/templates/default/recursor_service.conf.erb b/templates/default/recursor.conf.erb similarity index 100% rename from templates/default/recursor_service.conf.erb rename to templates/default/recursor.conf.erb diff --git a/test/cookbooks/pdns_test/recipes/authoritative_install_single_postgres.rb b/test/cookbooks/pdns_test/recipes/authoritative_install_single_postgres.rb index d5bf49f..b0fb1b2 100644 --- a/test/cookbooks/pdns_test/recipes/authoritative_install_single_postgres.rb +++ b/test/cookbooks/pdns_test/recipes/authoritative_install_single_postgres.rb @@ -40,15 +40,13 @@ include_recipe 'pdns_test::disable_systemd_resolved' -## Disable for ubuntu >=18.04 PowerDNS did not make a 40 repo for Bionic pdns_authoritative_install 'default' do series '43' backends [pg_backend_package] - not_if { node['platform'].include?('ubuntu') && node['platform_version'].to_f >= 18.04 } end pdns_authoritative_install 'default_upgrade' do - series '43' + series '44' backends [pg_backend_package] allow_upgrade true end diff --git a/test/integration/authoritative-multi/default_spec.rb b/test/integration/authoritative-multi/default_spec.rb index f0f396a..5b71903 100644 --- a/test/integration/authoritative-multi/default_spec.rb +++ b/test/integration/authoritative-multi/default_spec.rb @@ -31,9 +31,9 @@ end describe command('dig -p 53 chaos txt version.bind @127.0.0.1 +short') do - its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.3\.\d/) } + its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.4\.\d/) } end describe command('dig -p 54 chaos txt version.bind @127.0.0.1 +short') do - its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.3\.\d/) } + its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.4\.\d/) } end diff --git a/test/integration/authoritative-postgres/default_spec.rb b/test/integration/authoritative-postgres/default_spec.rb index ca48a84..4b2a82a 100644 --- a/test/integration/authoritative-postgres/default_spec.rb +++ b/test/integration/authoritative-postgres/default_spec.rb @@ -26,7 +26,7 @@ end describe command('dig chaos txt version.bind @127.0.0.1 +short') do - its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.3.\d/) } + its('stdout.chomp') { should match(/"PowerDNS Authoritative Server 4\.4.\d/) } end describe command('dig @127.0.0.1 smoke.example.org') do diff --git a/test/integration/recursor-multi/default_spec.rb b/test/integration/recursor-multi/default_spec.rb index e4fc0bb..3e2572d 100644 --- a/test/integration/recursor-multi/default_spec.rb +++ b/test/integration/recursor-multi/default_spec.rb @@ -31,11 +31,11 @@ end describe command('dig -p 53 chaos txt version.bind @127.0.0.1 +short') do - its('stdout.chomp') { should match(Regexp.new(/"PowerDNS Recursor 4\.3\.\d/)) } + its('stdout.chomp') { should match(Regexp.new(/"PowerDNS Recursor 4\.4\.\d/)) } end describe command('dig -p 54 chaos txt version.bind @127.0.0.1 +short') do - its('stdout.chomp') { should match(Regexp.new(/"PowerDNS Recursor 4\.3\.\d/)) } + its('stdout.chomp') { should match(Regexp.new(/"PowerDNS Recursor 4\.4\.\d/)) } end describe command('dig -p 53 @127.0.0.1 dnsimple.com') do