-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile.test
42 lines (31 loc) · 1.15 KB
/
justfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This list of actions
test:
@ just -l --unsorted | grep test
# Shows how to use the script
test-help:
# README for PKP's dojo playbooks
@ cat {{ rootPath }}/playbooks/test/README.md
@ echo ""
# An alias for "just list test" that shows a full list of test's actions
test-list:
@ just list test
# Test if you can reach global vars
test-vars:
@echo "Variable remoteHost: " {{ remoteHost }}
@echo "Variable rootPath: " {{ rootPath }}
# Test if you can pass arguments
test-args *arguments:
@echo "TEST ARGS: " $@
# Test if you can list playbook's folder
test-ls:
ls playbooks/test
# Runs an action with:
# - Action: Is the playbook name (without .yml) from playbooks/dojo.
# - Site: A "site" is an ansible dictionary read from inventory/sites.
# - Host: A "host" Acording to the inverntory/hosts.yml
# - Args: Additional arguments.
#
# Runs an action (playbook) with the specified site (dictionary) in the selected host.
test-run action host *args:
ansible-playbook -i {{ inventoryPath }}/hosts.yml --limit {{ host }} --vault-password-file \
{{ testPath }}/{{ vaultKey }} {{ testPath }}/{{ action }}.yml -K {{ args }}