Skip to content

Commit 8554220

Browse files
authored
Merge pull request #13 from badpacketsllc/10-upgrade-tests
Update tests to run using Molecule version 3
2 parents 51c8f75 + 4924294 commit 8554220

File tree

7 files changed

+38
-24
lines changed

7 files changed

+38
-24
lines changed

.prospector.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
autodetect: false
3+
4+
pylint:
5+
run: no

.yamllint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
---
12
extends: default
23

4+
ignore: .tox/
5+
36
rules:
47
braces:
58
max-spaces-inside: 1

meta/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ galaxy_info:
55
author: 'Mathew Woodyard'
66
company: 'Bad Packets LLC'
77
license: 'GPLv3'
8-
min_ansible_version: 2.0
8+
min_ansible_version: 2.4
99
platforms:
1010
- name: Amazon
11+
versions:
12+
- 2018.03
13+
- name: Amazon Linux 2
1114
versions:
1215
- all
1316
- name: EL
1417
versions:
1518
- 7
1619
- name: Fedora
1720
versions:
18-
- 29
19-
- 30
21+
- 31
22+
- 32
2023
- name: Debian
2124
versions:
2225
- stretch

molecule/default/Dockerfile.j2

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ FROM {{ item.registry.url }}/{{ item.image }}
66
FROM {{ item.image }}
77
{% endif %}
88

9-
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
10-
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
11-
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
12-
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
13-
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
14-
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
9+
{% if item.env is defined %}
10+
{% for var, value in item.env.items() %}
11+
{% if value %}
12+
ENV {{ var }} {{ value }}
13+
{% endif %}
14+
{% endfor %}
15+
{% endif %}
16+
17+
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 python3-apt aptitude && apt-get clean; \
18+
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all; \
19+
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
20+
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python3 sudo bash iproute2 && zypper clean -a; \
21+
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python3 sudo bash ca-certificates; \
22+
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python3 sudo bash ca-certificates iproute2 && xbps-remove -O; fi

molecule/default/molecule.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ dependency:
33
name: galaxy
44
driver:
55
name: docker
6-
lint:
7-
name: yamllint
6+
lint: |
7+
yamllint .
8+
ansible-lint
9+
prospector
810
platforms:
911
- name: instance
1012
image: "${MOLECULE_DISTRO}"
@@ -13,11 +15,5 @@ platforms:
1315
privileged: true
1416
provisioner:
1517
name: ansible
16-
lint:
17-
name: ansible-lint
18-
scenario:
19-
name: default
2018
verifier:
2119
name: testinfra
22-
lint:
23-
name: flake8

tox.ini

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ deps =
66
ansible
77
docker
88
molecule
9-
sitepackages = true
9+
testinfra
10+
yamllint
11+
ansible-lint
12+
prospector
1013

11-
[testenv:checkqa]
12-
deps = prospector
13-
commands = prospector
14-
15-
[testenv:amazonlinux-latest]
14+
[testenv:amazonlinux-2]
1615
setenv =
17-
MOLECULE_DISTRO=amazonlinux:latest
16+
MOLECULE_DISTRO=amazonlinux:2
1817
commands = molecule test
1918

2019
[testenv:amazonlinux-1]

0 commit comments

Comments
 (0)