feat: add molecule role testing
This commit is contained in:
parent
5483ee4c09
commit
9701ec9eac
3 changed files with 74 additions and 0 deletions
8
molecule/default/converge.yml
Normal file
8
molecule/default/converge.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: "converge"
|
||||||
|
hosts: "all"
|
||||||
|
become: true
|
||||||
|
gather_facts: true
|
||||||
|
roles:
|
||||||
|
- role: "siempie.dns"
|
||||||
44
molecule/default/molecule.yml
Normal file
44
molecule/default/molecule.yml
Normal 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"
|
||||||
22
molecule/default/verify.yml
Normal file
22
molecule/default/verify.yml
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue