diff --git a/.travis.yml b/.travis.yml index 14d0df8..a8b1cad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ matrix: install: - pip3 install tox-travis git-semver script: - - tox + - ./.travis/test.sh deploy: provider: script skip_cleanup: true diff --git a/.travis/test.sh b/.travis/test.sh index f4205ab..f1aa37f 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -1,8 +1,17 @@ #!/bin/bash +set -euo pipefail + +if [ ! -d "./molecule/latest" ]; then + tox + exit 0 +fi + if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - tox -- molecule test --all + tox -- molecule test --all --destroy never else tox -- molecule test -s default --destroy always - tox -- molecule test -s alternative --destroy never + if [ -d "./molecule/alternative" ]; then + tox -- molecule test -s alternative --destroy never + fi fi diff --git a/meta/main.yml b/meta/main.yml index 5a2fa8c..f76b0fe 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -14,6 +14,7 @@ galaxy_info: versions: - jessie - stretch + - buster - name: EL versions: - 7 diff --git a/molecule/alternative/molecule.yml b/molecule/alternative/molecule.yml index 3637865..2b2f864 100644 --- a/molecule/alternative/molecule.yml +++ b/molecule/alternative/molecule.yml @@ -24,8 +24,8 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - - name: jessie - image: paulfantom/debian-molecule:8 + - name: buster + image: paulfantom/debian-molecule:10 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: @@ -37,7 +37,7 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: fedora - image: paulfantom/fedora-molecule:27 + image: paulfantom/fedora-molecule:30 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index da480d9..1340084 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -24,8 +24,8 @@ platforms: privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - - name: jessie - image: paulfantom/debian-molecule:8 + - name: buster + image: paulfantom/debian-molecule:10 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: @@ -37,7 +37,7 @@ platforms: volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: fedora - image: paulfantom/fedora-molecule:27 + image: paulfantom/fedora-molecule:30 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: diff --git a/molecule/latest/molecule.yml b/molecule/latest/molecule.yml index 08708cb..ce38abd 100644 --- a/molecule/latest/molecule.yml +++ b/molecule/latest/molecule.yml @@ -6,14 +6,14 @@ driver: lint: name: yamllint platforms: - - name: stretch - image: paulfantom/debian-molecule:9 + - name: buster + image: paulfantom/debian-molecule:10 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - name: fedora - image: paulfantom/fedora-molecule:27 + image: paulfantom/fedora-molecule:30 docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" privileged: true volumes: diff --git a/tasks/main.yml b/tasks/main.yml index 04c5781..9c9b4ad 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,6 +2,7 @@ - name: Gather variables for each operating system include_vars: "{{ item }}" with_first_found: + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}.yml" - "{{ ansible_distribution_file_variety | lower }}.yml" - "{{ ansible_distribution | lower }}.yml" - "{{ ansible_os_family | lower }}.yml" diff --git a/test-requirements.txt b/test-requirements.txt index 7f5c289..8cdd22f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,3 +3,4 @@ docker ansible-lint>=3.4.0 testinfra>=1.7.0 jmespath +selinux diff --git a/vars/fedora.yml b/vars/fedora.yml new file mode 100644 index 0000000..b9b1f83 --- /dev/null +++ b/vars/fedora.yml @@ -0,0 +1,4 @@ +--- +node_exporter_dependencies: + - python3-libselinux + - python3-policycoreutils diff --git a/vars/redhat-8.yml b/vars/redhat-8.yml new file mode 100644 index 0000000..b9b1f83 --- /dev/null +++ b/vars/redhat-8.yml @@ -0,0 +1,4 @@ +--- +node_exporter_dependencies: + - python3-libselinux + - python3-policycoreutils