fix: skip running testinfra on excluded ansible versions

Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
gardar 2024-09-20 19:48:18 +00:00
parent b471a1f4a4
commit 3b679c9161
No known key found for this signature in database
GPG key ID: 00872BAF59D98753
66 changed files with 197 additions and 256 deletions

View file

@ -61,6 +61,8 @@ platforms:
command: /lib/systemd/systemd command: /lib/systemd/systemd
verifier: verifier:
name: testinfra name: testinfra
additional_files_or_dirs:
- "../../../../../.testinfra/testinfra_helpers.py"
provisioner: provisioner:
playbooks: playbooks:
converge: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/converge.yml" converge: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/converge.yml"

View file

@ -0,0 +1,67 @@
import os
import testinfra
def get_ansible_version():
"""
Get the current Ansible version from localhost using the 'debug' module.
Returns:
str: The current Ansible version (major.minor).
"""
localhost = testinfra.get_host(
"ansible://localhost?ansible_inventory=localhost,"
)
local_ansible_version = localhost.ansible("debug", "var=ansible_version")
ansible_version = '.'.join(
local_ansible_version['ansible_version']['full'].split('.')[:2]
)
return ansible_version
def filter_compatible_hosts(inventory, ansible_version):
"""
Filter hosts based on Ansible version compatibility.
Args:
inventory (str): The inventory file path.
ansible_version (str): The current Ansible version (major.minor).
Returns:
list: A list of compatible hosts that do not have the current Ansible
version in their exclude_ansible_vers hostvars.
"""
ansible_runner = testinfra.utils.ansible_runner.AnsibleRunner(inventory)
all_hosts = ansible_runner.get_hosts('all')
compatible_hosts = []
for host in all_hosts:
# Get host variables
host_vars = ansible_runner.get_variables(host)
# Check if the host should be excluded
if 'exclude_ansible_vers' in host_vars:
excluded_versions = host_vars['exclude_ansible_vers']
if ansible_version in excluded_versions:
continue
compatible_hosts.append(host)
return compatible_hosts
def get_target_hosts():
"""
Get the filtered target hosts based on the current Ansible version.
Returns:
list: A list of hosts that are compatible with
the current Ansible version.
"""
# Get current Ansible version
current_ansible_version = get_ansible_version()
# Get the inventory file from environment
inventory_file = os.environ['MOLECULE_INVENTORY_FILE']
# Filter the hosts based on the exclusion criteria
return filter_compatible_hosts(inventory_file, current_ansible_version)

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("dirs", [ @pytest.mark.parametrize("dirs", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest import pytest
from testinfra_helpers import get_target_hosts
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("dirs", [ @pytest.mark.parametrize("dirs", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_files(host): def test_files(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_files(host): def test_files(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,13 +1,11 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os
import yaml import yaml
import testinfra.utils.ansible_runner from testinfra_helpers import get_target_hosts
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.fixture() @pytest.fixture()

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("dirs", [ @pytest.mark.parametrize("dirs", [

View file

@ -1,13 +1,11 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os
import yaml import yaml
import testinfra.utils.ansible_runner from testinfra_helpers import get_target_hosts
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.fixture() @pytest.fixture()

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host): def test_directories(host):

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
import pytest import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host): def test_service(host):

View file

@ -1,11 +1,9 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_files(host): def test_files(host):

View file

@ -2,11 +2,9 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import pytest import pytest
import os from testinfra_helpers import get_target_hosts
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = get_target_hosts()
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [ @pytest.mark.parametrize("files", [