Debian Codegraph @

test/integration/targets/order/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 cleanup () {
6 files="shostlist.txt hostlist.txt"
7 for file in $files; do
8 if [[ -f "$file" ]]; then
9 rm -f "$file"
10 fi
11 done
12 }
13
14 for EXTRA in '{"inputlist": ["hostB", "hostA", "hostD", "hostC"]}' \
15 '{"myorder": "inventory", "inputlist": ["hostB", "hostA", "hostD", "hostC"]}' \
16 '{"myorder": "sorted", "inputlist": ["hostA", "hostB", "hostC", "hostD"]}' \
17 '{"myorder": "reverse_sorted", "inputlist": ["hostD", "hostC", "hostB", "hostA"]}' \
18 '{"myorder": "reverse_inventory", "inputlist": ["hostC", "hostD", "hostA", "hostB"]}' \
19 '{"myorder": "shuffle", "inputlist": ["hostC", "hostD", "hostA", "hostB"]}'
20 do
21 cleanup
22 ansible-playbook order.yml --forks 1 -i inventory -e "$EXTRA" "$@"
23 done
24 cleanup