Skip to content

Commit

Permalink
Merge pull request #131 from npmdnl/npmdnl-rec49
Browse files Browse the repository at this point in the history
Adding rec-49
  • Loading branch information
npmdnl authored Jul 10, 2023
2 parents 0a8c2c2 + 647ec02 commit 4c19b92
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
scenario:
- pdns-rec-47
- pdns-rec-48
- pdns-rec-49
- pdns-rec-master
steps:
- name: checkout
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An Ansible role created by the folks behind PowerDNS to setup the [PowerDNS Recu

## Requirements

An Ansible 2.7 or higher installation.
An Ansible 2.12 or higher installation.

## Dependencies

Expand Down Expand Up @@ -43,6 +43,12 @@ By default, the PowerDNS Recursor is installed from the software repositories co
roles:
- { role: PowerDNS.pdns_recursor,
pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_48 }}" }

# Install the PowerDNS Recursor from the '4.9.x' official repository
- hosts: pdns-recursors
roles:
- { role: PowerDNS.pdns_recursor,
pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_49 }}" }
```
The examples above, show how to install the PowerDNS Recursor from the official PowerDNS repositories
Expand Down Expand Up @@ -269,7 +275,7 @@ To test all the scenarios run

To run a custom molecule command

$ tox -e ansible210 -- molecule test -s pdns-rec-48
$ tox -e ansible210 -- molecule test -s pdns-rec-49

## License

Expand Down
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ galaxy_info:
description: Install and configure the PowerDNS Recursor
company: PowerDNS.COM BV
license: MIT
min_ansible_version: 2.7
min_ansible_version: 2.12
platforms:
- name: EL
versions:
- 7
- 8
- name: Debian
versions:
- stretch
- buster
- bullseye
- name: Ubuntu
versions:
- bionic
Expand Down
8 changes: 8 additions & 0 deletions molecule/pdns-rec-49/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-49.yml
roles:
- { role: pdns_recursor-ansible }
65 changes: 65 additions & 0 deletions molecule/pdns-rec-49/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---

scenario:
name: pdns-rec-49

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: ubuntu-1804
image: ubuntu:18.04
dockerfile_tpl: debian-systemd

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

- name: debian-10
image: debian:10
dockerfile_tpl: debian-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-49/
- ../systemd-overrides

41 changes: 41 additions & 0 deletions molecule/resources/tests/repo-49/test_repo_49.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

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


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-49.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-49.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-49.list')
if host.system_info.distribution.lower() in rhel_os:
f = host.file('/etc/yum.repos.d/powerdns-rec-49.repo')

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


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

assert 'PowerDNS Recursor' in cmd.stderr
assert '4.9' 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=')
7 changes: 7 additions & 0 deletions molecule/resources/vars/pdns-rec-repo-49.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

##
# PowerDNS Recursor 4.9.x Repository
##

pdns_rec_install_repo: "{{ pdns_rec_powerdns_repo_49 }}"
10 changes: 10 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ pdns_rec_powerdns_repo_48:
yum_debug_symbols_repo_baseurl: "https://repo.powerdns.com/centos/$basearch/$releasever/rec-48/debug"
name: "powerdns-rec-48"

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



default_pdns_rec_service_overrides: >-
{{ { 'User' : pdns_rec_user
Expand Down

0 comments on commit 4c19b92

Please sign in to comment.