Fix molecule tests so that PR's can properly validated (#180)

* Making molecule work again
* Enable newer os'es
This commit is contained in:
Werner Dijkerman
2023-10-20 18:06:02 +02:00
committed by GitHub
parent 94774fbc8d
commit da55c4a711
5 changed files with 25 additions and 14 deletions

View File

@ -22,23 +22,21 @@ on:
- '.github/workflows/telegraf.yml'
jobs:
molecule:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
molecule_distro:
- container: centos7
image: geerlingguy/docker-centos7-ansible:latest
- container: rocky8
image: geerlingguy/docker-rockylinux8-ansible
# - container: rocky9
# image: geerlingguy/docker-rockylinux9-ansible
- container: rocky9
image: geerlingguy/docker-rockylinux9-ansible
- container: ubuntu2204
image: geerlingguy/docker-ubuntu2204-ansible:latest
- container: ubuntu2004
image: geerlingguy/docker-ubuntu2004-ansible:latest
- container: ubuntu1804
image: geerlingguy/docker-ubuntu1804-ansible:latest
- container: ubuntu1604
image: geerlingguy/docker-ubuntu1604-ansible:latest
- container: debian9
image: geerlingguy/docker-debian9-ansible:latest
- container: debian10
@ -57,7 +55,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
curl -so requirements.txt 'https://raw.githubusercontent.com/dj-wasabi/dj-wasabi-release/main/requirements.txt'
pip install -r requirements.txt
- name: Run role tests on empty systems in check-mode

View File

@ -9,24 +9,28 @@
Emerson Knapp
Farshad Nematdoust
Greg
Harald Kraemer
Heckel, Robert J
Ilkka Tengvall
Ismael
Jack Ivy
Jeff Mahoney
Jeroen Geusebroek
Klett IT
Kyle
Laurent Hoss
Lex Rivera
Marcin Wito
Markus Langer
Matt
Max Nasonov
Miroslav Prasil
NotDead
Olivier Boukili
Pascal
Pavel Savchenko
PeterSzegedi
Pieter Lexis (TomTom)
Puneeth Nanjundaswamy
Rick Box
Rohit Gohri

View File

@ -4,6 +4,7 @@ dependency:
driver:
name: docker
role_name_check: 1
platforms:
- name: influxdb
image: influxdb:1.7-alpine
@ -19,10 +20,11 @@ platforms:
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: True
pre_build_image: True
cgroupns_mode: host
networks:
- name: telegraf
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
groups:
- telegraf
@ -64,5 +66,3 @@ scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8

View File

@ -4,16 +4,18 @@ dependency:
driver:
name: docker
role_name_check: 1
platforms:
- name: telegraf-${MY_MOLECULE_CONTAINER:-centos8}
image: ${MY_MOLECULE_IMAGE:-"geerlingguy/docker-centos8-ansible"}
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: True
pre_build_image: True
cgroupns_mode: host
networks:
- name: telegraf
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
groups:
- telegraf
@ -66,5 +68,3 @@ scenario:
- destroy
verifier:
name: testinfra
lint:
name: flake8

10
requirements.txt Normal file
View File

@ -0,0 +1,10 @@
ansible==8.2.0
ansible-compat==4.1.7
ansible-core==2.15.2
docker==6.1.3
molecule==6.0.1
molecule-docker==2.1.0
netaddr==0.8.0
pytest==7.4.2
pytest-testinfra==9.0.0
testinfra==6.0.0