Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
switch to molecule v3
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Dec 5, 2020
1 parent 8dc13ae commit a7cfda9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 108 deletions.
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends: default
ignore: |
.travis/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Deploy prometheus [node exporter](https://github.com/prometheus/node_exporter) u

## Requirements

- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
- Ansible >= 2.9 (It might work on previous versions, but we cannot guarantee it)
- gnu-tar on Mac deployer host (`brew install gnu-tar`)
- Passlib is required when using the basic authentatication feature (`pip install passlib[bcrypt]`)

Expand Down
18 changes: 7 additions & 11 deletions molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,44 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: bionic
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-18.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: xenial
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-16.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: stretch
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-9
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: buster
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-10
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: centos7
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:centos-7
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: centos8
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:centos-8
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
Expand All @@ -45,6 +49,7 @@ platforms:
groups:
- python3
- name: fedora
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:fedora-30
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
Expand All @@ -54,21 +59,12 @@ platforms:
- python3
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
create: ../default/create.yml
prepare: prepare.yml
converge: playbook.yml
destroy: ../default/destroy.yml
inventory:
group_vars:
python3:
ansible_python_interpreter: /usr/bin/python3
scenario:
name: alternative
verifier:
name: testinfra
lint:
name: flake8
enabled: true
37 changes: 0 additions & 37 deletions molecule/default/create.yml

This file was deleted.

32 changes: 0 additions & 32 deletions molecule/default/destroy.yml

This file was deleted.

23 changes: 12 additions & 11 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,49 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
# lint: |
# set -e
# yamllint .
# ansible-lint
# flake8
platforms:
- name: bionic
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-18.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: xenial
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-16.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: stretch
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-9
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: buster
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-10
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: centos7
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:centos-7
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: centos8
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:centos-8
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
Expand All @@ -45,6 +54,7 @@ platforms:
groups:
- python3
- name: fedora
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:fedora-30
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
Expand All @@ -54,21 +64,12 @@ platforms:
- python3
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
create: create.yml
prepare: prepare.yml
converge: playbook.yml
destroy: destroy.yml
inventory:
group_vars:
python3:
ansible_python_interpreter: /usr/bin/python3
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
enabled: true
11 changes: 2 additions & 9 deletions molecule/latest/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: buster
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-10
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: fedora
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:fedora-30
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
Expand All @@ -22,8 +22,6 @@ platforms:
- python3
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
create: ../default/create.yml
prepare: ../default/prepare.yml
Expand All @@ -33,10 +31,5 @@ provisioner:
group_vars:
python3:
ansible_python_interpreter: /usr/bin/python3
scenario:
name: latest
verifier:
name: testinfra
lint:
name: flake8
enabled: true
3 changes: 2 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
molecule>=2.15.0,<3.0.0
molecule>=3.0.0
molecule-docker
docker
ansible-lint>=3.4.0
testinfra>=1.7.0
Expand Down
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
[tox]
minversion = 1.8
basepython = python3.7
envlist = py37-ansible{27,28,29}
basepython = python3.8
envlist = py38-ansible{29,210}
skipsdist = true

[travis:env]
ANSIBLE=
2.7: ansible27
2.8: ansible28
2.9: ansible29
2.10: ansible210

[testenv]
passenv = GH_* DOCKER_HOST MOLECULE_*
deps =
-rtest-requirements.txt
ansible27: ansible<2.8
ansible28: ansible<2.9
ansible29: ansible<2.10
ansible210: ansible<2.11
commands =
{posargs:molecule test --all --destroy always}

0 comments on commit a7cfda9

Please sign in to comment.