Skip to content

Commit

Permalink
GH Actions: test weekly and new CI targets (#118)
Browse files Browse the repository at this point in the history
* gh actions: test weekly

* additional ci targets

* fix yaml lint issues

* meta/main.yml: update list of distros
  • Loading branch information
romeroalx committed Jan 17, 2024
1 parent 9091d13 commit ca381db
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 51 deletions.
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
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
on: [push, pull_request]
on:
push:
pull_request:
schedule:
- cron: '0 3 * * 0'

jobs:
Lint:
Expand Down
9 changes: 4 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ galaxy_info:
versions:
- "7"
- "8"
- "9"
- name: Debian
versions:
- jessie
- stretch
- buster
- bullseye
- bookworm
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- focal
- jammy
galaxy_tags:
- dnsdist
- dns
Expand Down
24 changes: 16 additions & 8 deletions molecule/dnsdist-16/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,30 @@ platforms:
image: centos:7
dockerfile_tpl: centos-systemd

- name: centos-8
image: quay.io/centos/centos:stream8
- 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
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: rockylinux-8
image: rockylinux:8
dockerfile_tpl: centos-systemd

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

provisioner:
name: ansible
options:
Expand All @@ -42,7 +50,7 @@ provisioner:
create: ../resources/create.yml
destroy: ../resources/destroy.yml
prepare: ../resources/prepare.yml

lint: yamllint vars tasks defaults meta

verifier:
Expand Down
36 changes: 28 additions & 8 deletions molecule/dnsdist-17/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,46 @@ platforms:
image: centos:7
dockerfile_tpl: centos-systemd

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

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

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

- name: ubuntu-2004
image: ubuntu:20.04
dockerfile_tpl: debian-systemd
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: 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
36 changes: 32 additions & 4 deletions molecule/dnsdist-18/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,50 @@ platforms:
image: centos:7
dockerfile_tpl: centos-systemd

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

- name: oraclelinux-9
image: oraclelinux:9
dockerfile_tpl: oraclelinux-systemd
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:
Expand All @@ -43,7 +71,7 @@ provisioner:
destroy: ../resources/destroy.yml
prepare: ../resources/prepare.yml

#lint: yamllint vars tasks defaults meta
# lint: yamllint vars tasks defaults meta

verifier:
name: testinfra
Expand Down
38 changes: 33 additions & 5 deletions molecule/dnsdist-master/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,50 @@ platforms:
image: centos:7
dockerfile_tpl: centos-systemd

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

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

- name: ubuntu-2004
image: ubuntu:20.04
dockerfile_tpl: debian-systemd
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:
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
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
2 changes: 1 addition & 1 deletion molecule/resources/host_vars/centos-8.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---

ansible_python_interpreter: "/usr/bin/python3"
ansible_python_interpreter: "/usr/bin/python3"
2 changes: 1 addition & 1 deletion molecule/resources/tests/all/test_common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re

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


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

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


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

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


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

debian_os = ['debian', 'ubuntu']
rhel_os = ['redhat', 'centos', 'oracleserver', 'oraclelinux']
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,7 +1,7 @@
import re

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

def test_repo_file(host):
f = None
Expand Down
Loading

0 comments on commit ca381db

Please sign in to comment.