From ea23d7fd54961788f0f24bb69c146655c3aea3e1 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 27 Jan 2019 04:44:24 +0000 Subject: [PATCH] issue #477: hacksmash weird 2.3 inventory_file var issue. --- .../integration/connection/disconnect_during_module.yml | 2 +- tests/ansible/run_ansible_playbook.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ansible/integration/connection/disconnect_during_module.yml b/tests/ansible/integration/connection/disconnect_during_module.yml index 18b6c7c1..e628e68e 100644 --- a/tests/ansible/integration/connection/disconnect_during_module.yml +++ b/tests/ansible/integration/connection/disconnect_during_module.yml @@ -12,7 +12,7 @@ - delegate_to: localhost command: | ansible-playbook - -i "{{inventory_file}}" + -i "{{MITOGEN_INVENTORY_FILE}}" integration/connection/_disconnect_during_module.yml args: chdir: ../.. diff --git a/tests/ansible/run_ansible_playbook.py b/tests/ansible/run_ansible_playbook.py index a4719a0c..51f864f4 100755 --- a/tests/ansible/run_ansible_playbook.py +++ b/tests/ansible/run_ansible_playbook.py @@ -42,6 +42,11 @@ extra = { 'git_basedir': GIT_BASEDIR, } +if '-i' in sys.argv: + extra['MITOGEN_INVENTORY_FILE'] = ( + os.path.abspath(sys.argv[1 + sys.argv.index('-i')]) + ) + args = ['ansible-playbook'] args += ['-e', json.dumps(extra)] args += sys.argv[1:]