diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4db00e..710e226 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,6 +50,7 @@ repos: entry: mypy lib/ pass_filenames: false additional_dependencies: + - ansible-lint>=5.1.0a0 - molecule - packaging - repo: https://github.com/pre-commit/mirrors-pylint @@ -57,5 +58,6 @@ repos: hooks: - id: pylint additional_dependencies: - - ansible-base + - ansible-core>=2.11.1 + - ansible-lint>=5.1.0a0 - molecule diff --git a/README.rst b/README.rst index 88b411f..153bf39 100644 --- a/README.rst +++ b/README.rst @@ -17,9 +17,13 @@ Molecule Podman Plugin :target: LICENSE :alt: Repository License -Molecule podman Plugin is designed to allow use Podman containers for +Molecule Podman Plugin is designed to allow use Podman containers for provisioning test resources. +This plugin requires `containers.podman` collection to be present: + + ansible-galaxy collection install containers.podman + Please note that this driver is currently in its early stage of development. .. _get-involved: diff --git a/lib/molecule_podman/driver.py b/lib/molecule_podman/driver.py index bbc9f09..4be51d5 100644 --- a/lib/molecule_podman/driver.py +++ b/lib/molecule_podman/driver.py @@ -23,6 +23,7 @@ import os +from ansiblelint.prerun import require_collection from molecule import logger from molecule.api import Driver from molecule.util import lru_cache @@ -189,3 +190,4 @@ def ansible_connection_options(self, instance_name): def sanity_checks(self): """Implement Podman driver sanity checks.""" log.info("Sanity checks: '{}'".format(self._name)) + require_collection("containers.podman", "1.6.1") diff --git a/setup.cfg b/setup.cfg index 6e2b3c2..270edb7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,6 +66,8 @@ setup_requires = # These are required in actual runtime: install_requires = + # we need require_collection from ansiblelint.prerun + ansiblelint >= 5.1.0a0 molecule >= 3.2.0 # selinux python module is needed as least by ansible-podman modules # and allows us of isolated (default) virtualenvs. It does not avoid need diff --git a/tox.ini b/tox.ini index 7fa872f..3e73d17 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,8 @@ deps = dockerfile: ansible>=2.9.12 selinux commands = - ansibledevel: ansible-galaxy install git+https://github.com/ansible-collections/community.general.git + ansibledevel: ansible-galaxy collection install git+https://github.com/containers/ansible-podman-collections + ansible-galaxy collection install containers.podman # failsafe as pip may install incompatible dependencies pip check # failsafe for preventing changes that may break pytest collection