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

Commit

Permalink
wip molecule
Browse files Browse the repository at this point in the history
  • Loading branch information
wookietreiber committed Dec 23, 2023
1 parent 13a731d commit f5081f4
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,35 @@ 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'

...
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ galaxy_info:
versions:
- '7'
- '8'
- '9'

- name: Ubuntu
versions:
Expand Down
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

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

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

# doesn't work because guest has cgroup1 and host cgroup2
# - name: centos-7
# image: geerlingguy/docker-centos7-ansible
# command: ${MOLECULE_DOCKER_COMMAND:-""}
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:rw
# cgroupns_mode: host
# 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

...
File renamed without changes.

0 comments on commit f5081f4

Please sign in to comment.