Skip to content

Commit

Permalink
Merge pull request #157 from romeroalx/test-alma-rocky
Browse files Browse the repository at this point in the history
Add OL9, Rocky and AlmaLinux 8 and 9 as CI targets
  • Loading branch information
npmdnl authored Jan 16, 2024
2 parents 41d3436 + 3ca970b commit bedf287
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
on:
push:
pull_request:
schedule:
- cron: '0 4 * * 0'

jobs:
Tests:
Expand All @@ -18,6 +20,7 @@ jobs:
- pdns-rec-49
- pdns-rec-50
- pdns-rec-master
fail-fast: false
steps:
- name: checkout
uses: actions/checkout@v3
Expand Down
20 changes: 20 additions & 0 deletions molecule/pdns-rec-48/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ platforms:
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
Expand All @@ -38,6 +42,22 @@ platforms:
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:
Expand Down
20 changes: 20 additions & 0 deletions molecule/pdns-rec-49/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ platforms:
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
Expand All @@ -38,6 +42,22 @@ platforms:
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:
Expand Down
20 changes: 20 additions & 0 deletions molecule/pdns-rec-50/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ 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
Expand All @@ -38,6 +42,22 @@ platforms:
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:
Expand Down
20 changes: 20 additions & 0 deletions molecule/pdns-rec-master/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ platforms:
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
Expand All @@ -38,6 +42,22 @@ platforms:
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:
Expand Down
4 changes: 2 additions & 2 deletions molecule/resources/Dockerfile.centos-systemd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM {{ item.image }}
ENV container docker

# Configure systemd to run into the container (see https://hub.docker.com/_/centos/)
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
RUN (cd /lib/systemd/system/sysinit.target.wants/ && for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
Expand All @@ -22,6 +22,6 @@ VOLUME [ "/sys/fs/cgroup" ]

CMD ["/usr/sbin/init"]

RUN if [ $(command -v dnf) ] && [ $(rpm -E %{rhel}) -eq 8 ]; then dnf makecache && dnf --assumeyes install python3 python3-devel python*-dnf bash iproute && dnf clean all; \
RUN if [ $(command -v dnf) ] && [ $(rpm -E %{rhel}) -eq 8 ] || [ $(rpm -E %{rhel}) -eq 9 ]; then dnf makecache && dnf --assumeyes install python3 python3-devel python*-dnf bash iproute && dnf clean all; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl net-tools bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; fi
2 changes: 1 addition & 1 deletion molecule/resources/tests/all/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


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


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion molecule/resources/tests/repo-48/test_repo_48.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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


def test_repo_file(host):
Expand Down
2 changes: 1 addition & 1 deletion molecule/resources/tests/repo-49/test_repo_49.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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


def test_repo_file(host):
Expand Down
2 changes: 1 addition & 1 deletion molecule/resources/tests/repo-50/test_repo_50.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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


def test_repo_file(host):
Expand Down
2 changes: 1 addition & 1 deletion molecule/resources/tests/repo-master/test_repo_master.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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


def test_repo_file(host):
Expand Down
12 changes: 7 additions & 5 deletions tasks/repo-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
package:
name: epel-release
state: present
when: ansible_distribution in [ 'CentOS' ]
when: ansible_distribution in [ 'CentOS', 'Rocky', 'AlmaLinux' ]

- name: Install epel-release on RHEL
package:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
state: present
when: ansible_distribution in [ 'RedHat' ]

# FIXME: this only works for 8
- name: Install epel-release on OracleLinux
package:
name: oracle-epel-release-el8
name:
- "oracle-epel-release-el{{ ansible_distribution_major_version }}"
- hostname
state: present
when: ansible_distribution in [ 'OracleLinux' ]

Expand All @@ -27,8 +28,9 @@
package:
name: yum-plugin-priorities
state: present
when: ansible_distribution in [ 'CentOS' ]
and ansible_pkg_mgr in [ 'yum' ]
when:
- ansible_distribution in [ 'CentOS', 'Rocky', 'AlmaLinux' ]
- ansible_distribution_major_version | int < 8

- name: Add the PowerDNS Recursor YUM Repository
yum_repository:
Expand Down

0 comments on commit bedf287

Please sign in to comment.