diff --git a/.config/molecule/config.yml b/.config/molecule/config.yml index 5bb016d9..8b9c8566 100644 --- a/.config/molecule/config.yml +++ b/.config/molecule/config.yml @@ -63,6 +63,8 @@ verifier: name: testinfra additional_files_or_dirs: - "../../../../../.testinfra/testinfra_helpers.py" + env: + PYTHONPATH: "${MOLECULE_PROJECT_DIRECTORY}/../../.testinfra:${PYTHONPATH}" provisioner: playbooks: converge: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/converge.yml" diff --git a/.testinfra/testinfra_helpers.py b/.testinfra/testinfra_helpers.py index 962f465e..ba93ef33 100644 --- a/.testinfra/testinfra_helpers.py +++ b/.testinfra/testinfra_helpers.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import testinfra diff --git a/roles/prometheus/molecule/default/tests/test_default.py b/roles/prometheus/molecule/default/tests/test_default.py index 518bcfd8..f5a392c4 100644 --- a/roles/prometheus/molecule/default/tests/test_default.py +++ b/roles/prometheus/molecule/default/tests/test_default.py @@ -3,6 +3,7 @@ __metaclass__ = type import yaml from testinfra_helpers import get_target_hosts +import os import pytest testinfra_hosts = get_target_hosts() diff --git a/roles/snmp_exporter/tasks/configure.yml b/roles/snmp_exporter/tasks/configure.yml index 7db0c4d4..bf52bd5e 100644 --- a/roles/snmp_exporter/tasks/configure.yml +++ b/roles/snmp_exporter/tasks/configure.yml @@ -13,7 +13,6 @@ ansible.builtin.get_url: url: "https://raw.githubusercontent.com/prometheus/snmp_exporter/v{{ snmp_exporter_version }}/snmp.yml" dest: /etc/snmp_exporter/snmp.yml - validate_certs: false owner: root group: root mode: 0644