feat: add molecule role testing

This commit is contained in:
Simon Cornet 2025-07-17 16:58:14 +02:00
commit 9701ec9eac
3 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,8 @@
---
- name: "converge"
hosts: "all"
become: true
gather_facts: true
roles:
- role: "siempie.dns"

View file

@ -0,0 +1,44 @@
---
dependency:
name: "galaxy"
driver:
name: "docker"
platforms:
# debian 12
- name: "debian-12"
image: "geerlingguy/docker-debian12-ansible:latest"
pre_build_image: true
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/lib/systemd/systemd"
# ubuntu 22
- name: "ubuntu-22"
image: "geerlingguy/docker-ubuntu2204-ansible:latest"
pre_build_image: true
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/lib/systemd/systemd"
# ubuntu 24
- name: "ubuntu-24"
image: "geerlingguy/docker-ubuntu2404-ansible:latest"
pre_build_image: true
privileged: true
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/lib/systemd/systemd"
provisioner:
name: "ansible"
env:
ANSIBLE_REMOTE_TMP: "/tmp"
verifier:
name: "ansible"

View file

@ -0,0 +1,22 @@
---
# verify
- name: "verify"
hosts: "all"
become: true
gather_facts: true
tasks:
# check if unbound is installed
- name: "check package"
ansible.builtin.package:
name: "unbound"
state: "present"
check_mode: true
# check if unbound is started
- name: "check service"
ansible.builtin.service:
name: "unbound"
state: "started"
check_mode: true