Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
wip adds molecule tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wookietreiber committed Jan 8, 2024
1 parent 6335cb0 commit de119ee
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,34 @@ jobs:
- uses: actions/checkout@v4
- uses: ansible/ansible-lint-action@v6

molecule:
needs:
- ansible-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro:
- archlinux
- centos-8
- rocky-8
- rocky-9
- ubuntu-bionic
- ubuntu-focal
- ubuntu-jammy
scenario:
- default
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip3 install ansible molecule molecule-plugins[docker] docker
- run: ansible --version
- run: molecule --version
- run: molecule test -p ${{ matrix.distro }} -s ${{ matrix.scenario }}
env:
ANSIBLE_DIFF_ALWAYS: 'True'
PY_COLORS: '1'

...
10 changes: 10 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

- name: Converge
hosts: all
tasks:
- name: Include idiv_biodiversity.ssh
ansible.builtin.include_role:
name: idiv_biodiversity.ssh

...
81 changes: 81 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---

dependency:
name: galaxy

driver:
name: docker

platforms:

- name: archlinux
image: carlodepieri/docker-archlinux-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
privileged: yes
pre_build_image: yes

- name: centos-8
image: geerlingguy/docker-centos8-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

- name: rocky-8
image: geerlingguy/docker-rockylinux8-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

- name: rocky-9
image: geerlingguy/docker-rockylinux9-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

- name: ubuntu-bionic
image: geerlingguy/docker-ubuntu1804-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

- name: ubuntu-focal
image: geerlingguy/docker-ubuntu2004-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

- name: ubuntu-jammy
image: geerlingguy/docker-ubuntu2204-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: yes
pre_build_image: yes

provisioner:
name: ansible
inventory:
host_vars:
archlinux:
ansible_user: ansible

verifier:
name: ansible

...

0 comments on commit de119ee

Please sign in to comment.