-
Notifications
You must be signed in to change notification settings - Fork 2
/
molecule.yml
87 lines (81 loc) · 2.48 KB
/
molecule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
## ref: https://github.com/ansible-community/molecule/discussions/3540?sort=top
## ref:
#prerun: true
prerun: false
dependency:
name: galaxy
enabled: true
options:
# vvv: true
ignore-certs: true
ignore-errors: true
# role-file: roles/requirements.molecule.yml
requirements-file: collections/requirements.molecule.yml
driver:
name: docker
#lint: |
# set -e
# yamllint .
# ansible-lint .
## ref: https://molecule.readthedocs.io/en/stable/configuration.html#platforms
## ref: https://github.com/robertdebock/ansible-role-python_pip/blob/master/molecule/default/molecule.yml
## ref: https://github.com/marketplace/actions/test-ansible-roles-with-molecule
platforms:
- name: ${MOLECULE_DISTRO:-centos8-systemd-python}-${MOLECULE_PLATFORM:-amd64}
image: ${MOLECULE_IMAGE_NAMESPACE:-lj020326}/${MOLECULE_DISTRO:-centos8-systemd-python}:${MOLECULE_IMAGE_TAG:-latest}
# command: ${MOLECULE_DOCKER_COMMAND:-""}
# command: ${MOLECULE_DOCKER_COMMAND:-"/sbin/init"}
command: ${MOLECULE_DOCKER_COMMAND:-"/lib/systemd/systemd"}
platform: ${MOLECULE_PLATFORM:-amd64}
tmpfs:
- /run
- /tmp
capabilities:
- SYS_ADMIN
- NET_ADMIN
- NET_RAW
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
## ref: https://github.com/docker/for-mac/issues/6073
## ref: https://github.com/moby/moby/issues/30723
## ref: https://unix.stackexchange.com/questions/683073/rocky-linux-container-with-systemd-on-macos
privileged: true
pre_build_image: true
cgroupns_mode: host
groups:
- ${MOLECULE_DOCKER_GROUP:-molecule_docker_linux}
## ref: https://molecule.readthedocs.io/en/latest/configuration.html?highlight=provisioner#molecule.provisioner.ansible.Ansible
provisioner:
name: ansible
lint:
name: ansible-lint
env:
## ref: https://stackoverflow.com/questions/61856958/molecule-test-roles-from-other-directory
ANSIBLE_ROLES_PATH: ../../roles
# options:
# v: true
## vvv: true
playbooks:
prepare: ../shared/prepare.yml
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
inventory:
links:
hosts: ../../inventory/xenv_groups.yml
group_vars: ../../inventory/group_vars
scenario:
name: default
## ref: https://blog.florianlopes.io/testing-ansible-roles-and-playbooks-with-molecule/
test_sequence:
- dependency
- cleanup
- syntax
- create
- prepare
- converge
# - idempotence
- verify
- cleanup
- destroy
verifier:
name: ansible