Skip to content

Commit

Permalink
added a script to execute the ansible playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
johningve authored and meling committed Jun 17, 2020
1 parent 6387749 commit 6a2e9f5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
inventory="$1"
args="${*:2}"

out=$(ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i "$inventory" -e "bench_args='$args'" benchmark.yml)
status=$?

if [ $status -eq 0 ]; then
echo "$out" | sed -n '/^MSG:/,/^PLAY/p' | sed '1d;$d'
else
echo -e "Error:\n$out"
exit $status
fi

0 comments on commit 6a2e9f5

Please sign in to comment.