test: Configure Molecule testing framework
- Add Ansible collections configuration - Update converge and prepare playbooks - Restructure molecule.yml for improved testing
This commit is contained in:
7
molecule/default/collections.yml
Normal file
7
molecule/default/collections.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
collections:
|
||||
- name: ansible.utils
|
||||
- name: ansible.posix
|
||||
- name: community.crypto
|
||||
- name: community.general
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
roles:
|
||||
- keepit.bind9
|
||||
tasks:
|
||||
- name: Include bind9 role
|
||||
ansible.builtin.include_role:
|
||||
name: ../../../ansible-bind9-role
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: podman
|
||||
platforms:
|
||||
- name: ubuntu-jammy
|
||||
image: ubuntu:jammy
|
||||
- name: ubuntu-focal
|
||||
image: ubuntu:focal
|
||||
- name: debian-bullseye
|
||||
image: debian:bullseye
|
||||
- name: debian-bookworm
|
||||
image: docker.io/jrei/systemd-debian:12
|
||||
command: /lib/systemd/systemd
|
||||
privileged: true
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
cgroupns_mode: host
|
||||
- name: debian-trixie
|
||||
image: docker.io/jrei/systemd-debian:13
|
||||
command: /lib/systemd/systemd
|
||||
privileged: true
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
cgroupns_mode: host
|
||||
provisioner:
|
||||
name: ansible
|
||||
lint:
|
||||
name: ansible-lint
|
||||
config_options:
|
||||
defaults:
|
||||
ALLOW_BROKEN_CONDITIONALS: true
|
||||
verifier:
|
||||
name: ansible
|
||||
lint: |
|
||||
set -e
|
||||
ansible-lint .
|
||||
yamllint .
|
||||
|
||||
6
molecule/default/prepare.yml
Normal file
6
molecule/default/prepare.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Update apt
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
Reference in New Issue
Block a user