Empty file removed .github/workflows/acceptance.yml
Empty file.
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
schedule:
- cron: '4 4 * * *'

jobs:
setup_matrix:
if: github.event_name != 'schedule' || github.repository_owner == 'theforeman'
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
outputs:
beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }}
puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }}
env:
BUNDLE_WITHOUT: development:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run rake check
run: bundle exec rake check
- name: Run rake validate
run: bundle exec rake validate
- name: Run rake lint
run: bundle exec rake lint
- name: Setup Test Matrix
id: get_outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS

unit:
needs: setup_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "${{ matrix.puppet }}.0"
name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake parallel_spec

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
Empty file removed .github/workflows/cron.yml
Empty file.
Empty file removed .github/workflows/unit.yml
Empty file.
11 changes: 2 additions & 9 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
---
.travis.yml:
beaker_sets:
- centos6-64
- debian8-64
- debian9-64
- debian10-64
- ubuntu1604-64
- ubuntu1804-64
.github/workflows/ci.yml:
pidfile_workaround: CentOS
145 changes: 0 additions & 145 deletions .travis.yml

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [8.2.0](https://github.com/theforeman/puppet-dns/tree/8.2.0) (2021-04-26)

[Full Changelog](https://github.com/theforeman/puppet-dns/compare/8.1.0...8.2.0)

**Implemented enhancements:**

- Support Puppet 7 [\#184](https://github.com/theforeman/puppet-dns/pull/184) ([ekohl](https://github.com/ekohl))
- Drop Fedora 26, add Fedora 32 [\#181](https://github.com/theforeman/puppet-dns/pull/181) ([ekohl](https://github.com/ekohl))
- Allow configuration checks to be turned off [\#178](https://github.com/theforeman/puppet-dns/pull/178) ([coreone](https://github.com/coreone))

## [8.1.0](https://github.com/theforeman/puppet-dns/tree/8.1.0) (2020-10-27)

[Full Changelog](https://github.com/theforeman/puppet-dns/compare/8.0.0...8.1.0)
Expand Down
20 changes: 11 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-undef_in_function-check'
gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-empty_string-check', {"groups"=>["test"]}
gem 'puppet-lint-file_ensure-check', {"groups"=>["test"]}
gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4'
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 0.2', {"groups"=>["system_tests"]}
gem 'voxpupuli-acceptance', '~> 0.3', {"groups"=>["system_tests"]}

# vim:ft=ruby
10 changes: 8 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Configure dns
# @api private
class dns::config {
if $dns::config_check {
$validate_cmd = "${dns::named_checkconf} %"
} else {
$validate_cmd = undef
}

concat { $dns::publicviewpath:
owner => root,
group => $dns::params::group,
mode => '0640',
validate_cmd => "${dns::named_checkconf} %",
validate_cmd => $validate_cmd,
}

if $dns::enable_views {
Expand All @@ -28,7 +34,7 @@
group => $dns::params::group,
mode => '0640',
require => Concat[$dns::optionspath],
validate_cmd => "${dns::named_checkconf} %",
validate_cmd => $validate_cmd,
}

# This file cannot be checked by named-checkconf because its content is only
Expand Down
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
# setting `service_restart_command` to `/usr/sbin/service bind9 reload` or
# `/usr/sbin/rndc reload` or even `/usr/bin/systemctl try-reload-or-restart bind9`.
# Default is 'undef' so the service resource default is used.
# @param config_check
# Should this module run configuration checks before putting new configurations in
# place? Defaults to true. Set to false if you don't want configuration checks when
# config files are changed.
# @param additional_options
# Additional options
# @param additional_directives
Expand Down Expand Up @@ -168,6 +172,7 @@
Variant[Enum['running', 'stopped'], Boolean] $service_ensure = $dns::params::service_ensure,
Boolean $service_enable = $dns::params::service_enable,
Optional[String[1]] $service_restart_command = $dns::params::service_restart_command,
Boolean $config_check = $dns::params::config_check,
Hash[String, Data] $additional_options = $dns::params::additional_options,
Array[String] $additional_directives = $dns::params::additional_directives,
Boolean $enable_views = $dns::params::enable_views,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
$manage_service = true
$service_ensure = 'running'
$service_enable = true
$config_check = true
$acls = {}

$additional_options = {}
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-dns",
"version": "8.1.0",
"version": "8.2.0",
"author": "theforeman",
"summary": "Manage the ISC BIND daemon",
"license": "Apache-2.0",
Expand Down Expand Up @@ -28,7 +28,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 5.5.8 < 7.0.0"
"version_requirement": ">= 5.5.8 < 8.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -58,7 +58,7 @@
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"26"
"32"
]
},
{
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/dns_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,17 @@
it { should contain_file("#{etc_directory}/dns-key.key") }
end

describe 'with config_check set to false' do
let(:params) { { :config_check => false } }

it { is_expected.to compile.with_all_deps }

it {
is_expected.to contain_concat("#{etc_directory}/named.conf")
.without_validate_cmd()
}
end

context 'sysconfig', if: ['Debian', 'RedHat'].include?(os_facts[:os]['family']) do
let(:sysconfig_named_path) do
case facts[:os]['family']
Expand Down
12 changes: 12 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@
package { $package:
ensure => installed,
}

# Needed for the ss and sysctl commands in testing and not included in the base container
if $facts['os']['name'] == 'Fedora' {
package { ['iproute', 'procps-ng']:
ensure => installed,
}
}

# The both IPv4 and IPv6 are used to test views
exec { 'sysctl -w net.ipv6.conf.all.disable_ipv6=0':
path => ['/usr/sbin', '/sbin', '/usr/bin', '/bin'],
}