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

Add support for dnsdist 1.9 #117

Open
wants to merge 9 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
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
exclude_paths:
- molecule/
skip_list:
- '306' # [306] Shells that use pipes should set the pipefail option
- '306' # [306] Shells that use pipes should set the pipefail option
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- dnsdist-16
- dnsdist-17
- dnsdist-18
- dnsdist-19
- dnsdist-master
steps:
- name: checkout
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ galaxy_info:
- "8"
- name: Debian
versions:
- jessie
- stretch
- buster
- bookworm
- name: Ubuntu
versions:
- trusty
Expand Down
4 changes: 0 additions & 4 deletions molecule/dnsdist-16/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ platforms:
image: quay.io/centos/centos:stream8
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
Expand Down
4 changes: 0 additions & 4 deletions molecule/dnsdist-17/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ platforms:
image: oraclelinux:9
dockerfile_tpl: oraclelinux-systemd

- name: ubuntu-1804
image: ubuntu:18.04
dockerfile_tpl: debian-systemd

- name: ubuntu-2004
image: ubuntu:20.04
dockerfile_tpl: debian-systemd
Expand Down
8 changes: 8 additions & 0 deletions molecule/dnsdist-18/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ platforms:
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

provisioner:
name: ansible
options:
Expand Down
8 changes: 8 additions & 0 deletions molecule/dnsdist-19/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- hosts: all
vars_files:
- ../resources/vars/dnsdist-common.yml
- ../resources/vars/dnsdist-repo-19.yml
roles:
- { role: powerdns.dnsdist }
63 changes: 63 additions & 0 deletions molecule/dnsdist-19/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---

scenario:
name: dnsdist-19

driver:
name: docker

dependency:
name: galaxy

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

- name: centos-8
image: quay.io/centos/centos:stream8
dockerfile_tpl: centos-systemd

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

- name: ubuntu-2004
image: ubuntu:20.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

provisioner:
name: ansible
options:
diff: True
v: True
inventory:
links:
host_vars: ../resources/host_vars/
playbooks:
create: ../resources/create.yml
destroy: ../resources/destroy.yml
prepare: ../resources/prepare.yml

#lint: yamllint vars tasks defaults meta

verifier:
name: testinfra
options:
vvv: True
directory: ../resources/tests/all
additional_files_or_dirs:
# path relative to 'directory'
- ../repo-19/
25 changes: 25 additions & 0 deletions molecule/resources/Dockerfile.debian-python3.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Molecule managed

FROM {{ item.image }}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y systemd && apt-get clean; fi
RUN if [ ! -e /sbin/init ]; then ln -s /lib/systemd/systemd /sbin/init ; fi

ENV container docker

# Don't start the optional systemd services.
RUN find /etc/systemd/system \
/lib/systemd/system \
-path '*.wants/*' \
-not -name '*journald*' \
-not -name '*systemd-tmpfiles*' \
-not -name '*systemd-user-sessions*' \
-exec rm \{} \;

RUN systemctl set-default multi-user.target

VOLUME [ "/sys/fs/cgroup" ]

CMD ["/sbin/init"]

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash net-tools ca-certificates && apt-get clean; fi
3 changes: 3 additions & 0 deletions molecule/resources/host_vars/debian-11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

ansible_python_interpreter: "/usr/bin/python3"
3 changes: 3 additions & 0 deletions molecule/resources/host_vars/debian-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

ansible_python_interpreter: "/usr/bin/python3"
32 changes: 32 additions & 0 deletions molecule/resources/tests/repo-19/test_repo_19.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

debian_os = ['debian', 'ubuntu']
rhel_os = ['redhat', 'centos', 'oracleserver', 'oraclelinux']


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

assert f.exists
assert f.contains('dnsdist-19')


def test_pdns_version(host):
cmd = host.run('/usr/bin/dnsdist --version')

assert 'dnsdist 1.9' in cmd.stdout
7 changes: 7 additions & 0 deletions molecule/resources/vars/dnsdist-repo-19.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

##
# Dnsdist 1.9.x Repository
##

dnsdist_install_repo: "{{ dnsdist_powerdns_repo_19 }}"
9 changes: 9 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ dnsdist_powerdns_repo_18:
yum_repo_baseurl: http://repo.powerdns.com/centos/$basearch/$releasever/dnsdist-18
yum_debug_symbols_repo_baseurl: http://repo.powerdns.com/centos/$basearch/$releasever/dnsdist-18/debug
name: powerdns-dnsdist-18

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