diff --git a/molecule/default/playbook.yml b/molecule/default/converge.yml similarity index 100% rename from molecule/default/playbook.yml rename to molecule/default/converge.yml diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index b8fabac..1836687 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -7,7 +7,6 @@ lint: | set -e yamllint . ansible-lint - # flake8 platforms: - name: centos-7 image: centos:7 @@ -28,4 +27,4 @@ platforms: provisioner: name: ansible verifier: - name: testinfra + name: ansible diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index 7e077e6..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -Validate host properties using Pytest after Ansible is finished. Uses Testinfra - -Possible tests: -- https://testinfra.readthedocs.io/en/latest/modules.html#host -""" - -import os -# import pytest -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE'] -).get_hosts('all') - - -def test_borgmatic_config(host): - f = host.file('/etc/borgmatic/config.yaml') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' - - -# @pytest.mark.parametrize('file, content', [ -# ("/etc/firewalld/zones/public.xml", ""), -# ("/var/www/html/index.html", "Managed by Ansible") -# ]) -# def test_files(host, file, content): -# file = host.file(file) - -# assert file.exists -# assert file.contains(content) diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml new file mode 100644 index 0000000..0736e6f --- /dev/null +++ b/molecule/default/verify.yml @@ -0,0 +1,7 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Example assertion + assert: + that: true \ No newline at end of file