Skip to content

Commit

Permalink
Fixed molecule tests
Browse files Browse the repository at this point in the history
Using Molecule driver containers fixes tests on systems with docker and podman installed. Deprecated and EOL container images are dropped.

closes #6
  • Loading branch information
wsmirnow committed Jan 10, 2025
1 parent b32aa5a commit 8125ca9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
5 changes: 3 additions & 2 deletions .dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ ansible-lint
dnspython
yamllint
molecule
molecule-docker
molecule-podman
molecule-plugins
molecule-plugins[docker]
molecule-plugins[podman]
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
run: pip3 install -r .dev_requirements.txt

- name: test playbook
run: molecule test --driver-name docker
run: molecule test
env:
PY_COLORS: '1'
5 changes: 4 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ galaxy_info:
platforms:
- name: EL
versions:
- 7
- 8
- 9
- name: Debian
versions:
- bullseye
- bookworm
- name: Ubuntu
versions:
- focal
- jammy
- noble
dependencies: []
2 changes: 1 addition & 1 deletion molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ FROM {{ item.image }}
{% if "centos" in item.name %}
RUN dnf install --refresh -y sudo systemd bash ca-certificates iproute python39 python3-libselinux
{% else %}
RUN apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 init python3 && apt-get clean
RUN apt-get update && apt-get install -y sudo init bash ca-certificates iproute2 python3 && apt-get clean
{% endif %}
27 changes: 8 additions & 19 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,33 @@ dependency:
name: galaxy
enabled: false
driver:
name: podman
name: containers
platforms:
- name: opencast-nginx-centos8
image: quay.io/centos/centos:stream8
pre_build_image: false
command: /sbin/init
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: opencast-nginx-centos9
image: quay.io/centos/centos:stream9
pre_build_image: false
command: /sbin/init
tmpfs:
- /run
- /tmp
"/tmp": "exec"
"/run": "rw,noexec,nosuid,nodev"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: opencast-nginx-debian
image: docker.io/debian:stable
pre_build_image: false
privileged: true
command: /sbin/init
tmpfs:
- /run
- /tmp
"/tmp": "exec"
"/run": "rw,noexec,nosuid,nodev"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: opencast-nginx-ubuntu
image: docker.io/ubuntu:20.04
image: docker.io/ubuntu:latest
pre_build_image: false
privileged: true
command: /sbin/init
tmpfs:
- /run
- /tmp
"/tmp": "exec"
"/run": "rw,noexec,nosuid,nodev"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
lint: |
Expand Down

0 comments on commit 8125ca9

Please sign in to comment.