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 "$@"