Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Recursor 5.1 #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- pdns-rec-48
- pdns-rec-49
- pdns-rec-50
- pdns-rec-51
- pdns-rec-master
fail-fast: false
steps:
Expand Down
8 changes: 8 additions & 0 deletions molecule/pdns-rec-51/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- hosts: all
vars_files:
- ../resources/vars/pdns-rec-common.yml
- ../resources/vars/pdns-rec-repo-51.yml
roles:
- { role: pdns_recursor-ansible }
92 changes: 92 additions & 0 deletions molecule/pdns-rec-51/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---

scenario:
name: pdns-rec-51

driver:
name: docker

dependency:
name: galaxy

platforms:
- name: centos-7
image: centos:7
dockerfile_tpl: centos-systemd

- name: oraclelinux-8
image: oraclelinux:8
dockerfile_tpl: centos-systemd

- name: oraclelinux-9
image: oraclelinux:9
dockerfile_tpl: centos-systemd

- name: ubuntu-2004
image: ubuntu:20.04
dockerfile_tpl: ubuntu-systemd

- name: ubuntu-2204
image: ubuntu:22.04
dockerfile_tpl: ubuntu-systemd

- name: debian-10
image: debian:10
dockerfile_tpl: debian-systemd

- name: debian-11
image: debian:11
dockerfile_tpl: debian-python3

- name: debian-12
image: debian:12
dockerfile_tpl: debian-python3

- name: rockylinux-8
image: rockylinux:8
dockerfile_tpl: centos-systemd

- name: almalinux-8
image: almalinux:8
dockerfile_tpl: centos-systemd

- name: rockylinux-9
image: rockylinux:9.0
dockerfile_tpl: centos-systemd

- name: almalinux-9
image: almalinux:9
dockerfile_tpl: centos-systemd

provisioner:
name: ansible
options:
diff: True
v: True
config_options:
defaults:
gathering: smart
fact_caching: jsonfile
fact_caching_connection: .ansible_cache
fact_caching_timeout: 7200
ssh_connection:
pipelining: true
inventory:
links:
host_vars: ../resources/host_vars/
playbooks:
create: ../resources/create.yml
destroy: ../resources/destroy.yml
prepare: ../resources/prepare.yml
lint: ansible-lint -x ANSIBLE0006 ANSIBLE0016

lint: yamllint vars tasks defaults meta

verifier:
name: testinfra
options:
vvv: True
directory: ../resources/tests/all
additional_files_or_dirs:
- ../repo-51/
- ../systemd-overrides
41 changes: 41 additions & 0 deletions molecule/resources/tests/repo-51/test_repo_51.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

debian_os = ['debian', 'ubuntu']
rhel_os = ['redhat', 'centos', 'ol', 'rocky', 'almalinux']


def test_repo_file(host):
f = None
if host.system_info.distribution.lower() in debian_os:
f = host.file('/etc/apt/sources.list.d/powerdns-rec-51.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-51.repo')

assert f.exists
assert f.user == 'root'
assert f.group == 'root'


def test_pdns_repo(host):
f = None
if host.system_info.distribution.lower() in debian_os:
f = host.file('/etc/apt/sources.list.d/powerdns-rec-51.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-51.repo')

assert f.exists
assert f.contains('rec-51')


def test_pdns_version(host):
cmd = host.run('/usr/sbin/pdns_recursor --version')

assert 'PowerDNS Recursor' in cmd.stderr
assert '5.0' in cmd.stderr


def systemd_override(host):
fname = '/etc/systemd/system/pdns-recursor.service.d/override.conf'
f = host.file(fname)

assert not f.contains('User=')
assert not f.contains('Group=')
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ molecule-plugins[docker]==23.4.1
molecule-plugins[lint]==23.4.1
molecule==5.1.0
pytest-testinfra==10.1.0
docker==7.0.0
docker==7.1.0
9 changes: 9 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ pdns_rec_powerdns_repo_50:
yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-50/debug
name: powerdns-rec-50

pdns_rec_powerdns_repo_51:
apt_repo_origin: repo.powerdns.com
apt_repo: deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-51 main
gpg_key: https://repo.powerdns.com/FD380FBB-pub.asc
gpg_key_id: 9FAAA5577E8FCF62093D036C1B0C6205FD380FBB
yum_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-51
yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-51/debug
name: powerdns-rec-51

default_pdns_rec_service_overrides: >-
{{ { 'User' : pdns_rec_user
, 'Group' : pdns_rec_group
Expand Down
Loading