Update Molecule file conventions to v3.

This commit is contained in:
Manu 2020-02-25 22:08:29 +08:00
parent 615f261a3d
commit 0bcece6447
4 changed files with 8 additions and 35 deletions

View File

@ -7,7 +7,6 @@ lint: |
set -e set -e
yamllint . yamllint .
ansible-lint ansible-lint
# flake8
platforms: platforms:
- name: centos-7 - name: centos-7
image: centos:7 image: centos:7
@ -28,4 +27,4 @@ platforms:
provisioner: provisioner:
name: ansible name: ansible
verifier: verifier:
name: testinfra name: ansible

View File

@ -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", "<service name=\"http\"/>"),
# ("/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)

View File

@ -0,0 +1,7 @@
---
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true