From 29288b236b6a1db6abc6244df287823a2b30b3bc Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 5 Apr 2018 19:34:44 +0100 Subject: [PATCH] issue #164: import run_ansible_playbook.sh. --- tests/ansible/README.md | 8 +++++++- tests/ansible/run_ansible_playbook.sh | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 tests/ansible/run_ansible_playbook.sh diff --git a/tests/ansible/README.md b/tests/ansible/README.md index 7eb04769..fe343125 100644 --- a/tests/ansible/README.md +++ b/tests/ansible/README.md @@ -8,9 +8,15 @@ It will be tidied up over time, meanwhile, the playbooks here are a useful demonstrator for what does and doesn't work. +## ``run_ansible_playbook.sh`` + +This is necessary to set some environment variables used by future tests, as +there appears to be no better way to inject them into the top-level process +environment before the Mitogen connection process forks. + ## Running Everything ``` -ANSIBLE_STRATEGY=mitogen_linear ansible-playbook all.yml +ANSIBLE_STRATEGY=mitogen_linear ./run_ansible_playbook.sh all.yml ``` diff --git a/tests/ansible/run_ansible_playbook.sh b/tests/ansible/run_ansible_playbook.sh new file mode 100755 index 00000000..1df82047 --- /dev/null +++ b/tests/ansible/run_ansible_playbook.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Wrap ansible-playbook, setting up some test of the test environment. + +# Used by delegate_to.yml to ensure "sudo -E" preserves environment. +export I_WAS_PRESERVED=1 + +exec ansible-playbook "$@"