From 6c5c42fca6e3f557b92fd99dc9a9b4ca75bab911 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 18 Sep 2019 14:21:35 +0200 Subject: [PATCH] use symlink to fix testinfra iptables module --- molecule/ec2-centos-7/playbook.yml | 10 ++++++++++ molecule/ec2-centos-7/tests/test_default.py | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/molecule/ec2-centos-7/playbook.yml b/molecule/ec2-centos-7/playbook.yml index 26eccb7..1789e17 100644 --- a/molecule/ec2-centos-7/playbook.yml +++ b/molecule/ec2-centos-7/playbook.yml @@ -1,5 +1,15 @@ --- - name: Converge hosts: all + + pre_tasks: + - name: Add symlink for iptables + file: + src: /usr/sbin/iptables + dest: /usr/bin/iptables + owner: root + group: root + state: link + roles: - role: xoxys.iptables diff --git a/molecule/ec2-centos-7/tests/test_default.py b/molecule/ec2-centos-7/tests/test_default.py index d6af129..86313ed 100644 --- a/molecule/ec2-centos-7/tests/test_default.py +++ b/molecule/ec2-centos-7/tests/test_default.py @@ -1,5 +1,4 @@ import os -import sys import testinfra.utils.ansible_runner @@ -9,8 +8,6 @@ warnings.filterwarnings("ignore", category=DeprecationWarning) testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') -sys.path.append('/usr/sbin') - def test_iptables_is_installed(host): iptables = host.package("iptables")