summaryrefslogtreecommitdiffstats
path: root/ansible/run_include
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-10-12 09:54:31 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-10-12 09:54:31 +0200
commit1f6bab9ef5ffec068dac0a0785e703a55b335ce5 (patch)
tree0df51642c3f68cc9fa164a36408f97cc5bec118f /ansible/run_include
parent98df0c8b79a964c94df0c7b731fe790073214eba (diff)
downloadpostgresql-setup-tests-1f6bab9ef5ffec068dac0a0785e703a55b335ce5.tar.gz
postgresql-setup-tests-1f6bab9ef5ffec068dac0a0785e703a55b335ce5.tar.xz
postgresql-setup-tests-1f6bab9ef5ffec068dac0a0785e703a55b335ce5.zip
run_include: fix to be more like 'run_remote'
* ansible/dummy-wrapper.yml: Do not require 'script_name' variable. * ansible/run_include: Better work with actual directory when including other scripts or searching for included playbook.
Diffstat (limited to 'ansible/run_include')
-rwxr-xr-xansible/run_include18
1 files changed, 14 insertions, 4 deletions
diff --git a/ansible/run_include b/ansible/run_include
index 3a47f68..1c7cd98 100755
--- a/ansible/run_include
+++ b/ansible/run_include
@@ -2,7 +2,17 @@
export ANSIBLE_HOST_KEY_CHECKING=False
-ansible-playbook -i hosts \
- --extra-vars "include_file=$1" \
- --extra-vars "script_name=dummy target=host" \
- ./dummy-wrapper.yml
+workdir="$(dirname "${BASH_SOURCE[0]}")"
+workdir=$(readlink -f "$workdir")
+
+export playbook=$(readlink -f "$1")
+
+( set -x
+ cd "$workdir"
+
+ ansible-playbook -i "$workdir/../hosts" \
+ --extra-vars "include_file=$playbook" \
+ --extra-vars "script_name=dummy" \
+ --extra-vars "target=host" \
+ "dummy-wrapper.yml"
+)