Skip to content

Commit

Permalink
Add rec-52
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodenhaltung committed Jan 20, 2025
1 parent 10c675c commit 6416f6c
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- pdns-rec-49
- pdns-rec-50
- pdns-rec-51
- pdns-rec-52
- pdns-rec-master
fail-fast: false
steps:
Expand Down
8 changes: 8 additions & 0 deletions molecule/pdns-rec-52/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-52.yml
roles:
- { role: pdns_recursor-ansible }
84 changes: 84 additions & 0 deletions molecule/pdns-rec-52/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---

scenario:
name: pdns-rec-52

driver:
name: docker

dependency:
name: galaxy

platforms:
- 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-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-52/
- ../systemd-overrides
41 changes: 41 additions & 0 deletions molecule/resources/tests/repo-52/test_repo_52.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-52.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-52.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-52.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-52.repo')

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


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

assert 'PowerDNS Recursor' in cmd.stderr or 'PowerDNS Recursor' in cmd.stdout
assert '5.2' in cmd.stderr or '5.2' in cmd.stdout


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=')
11 changes: 11 additions & 0 deletions molecule/resources/vars/pdns-rec-repo-52.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

##
# PowerDNS Recursor 5.2.x Repository
##

pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_52 }}"

pdns_rec_service_overrides:
LimitCORE: infinity
ExecStart: /usr/sbin/pdns_recursor --daemon=no --write-pid=no --disable-syslog --log-timestamp=no --enable-old-settings
9 changes: 9 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ pdns_rec_powerdns_repo_51:
yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-51/debug
name: powerdns-rec-51

pdns_rec_powerdns_repo_52:
apt_repo_origin: repo.powerdns.com
apt_repo: deb [arch=amd64] https://repo.powerdns.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }}-rec-52 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-52
yum_debug_symbols_repo_baseurl: https://repo.powerdns.com/centos/$basearch/$releasever/rec-52/debug
name: powerdns-rec-52

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

0 comments on commit 6416f6c

Please sign in to comment.