File tree 4 files changed +28
-11
lines changed
4 files changed +28
-11
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ infra/docker/mysql_backup_mystamps.sql.gz
41
41
42
42
# created by src/main/scripts/ci/deploy.sh
43
43
vault-pass.txt
44
+ prod_vars.yml
44
45
45
46
# maven-wrapper
46
47
.mvn /wrapper /maven-wrapper.jar
Original file line number Diff line number Diff line change 3
3
- hosts : all
4
4
gather_facts : no
5
5
remote_user : mystamps
6
+ vars_files :
7
+ - prod_vars.yml
6
8
vars :
7
9
local_war_dir : " {{ playbook_dir }}/../../../../../target"
8
10
remote_war_dir : /data/mystamps
9
- uptimerobot :
10
- monitorid : ' MyStamps'
11
- apikey : " {{ lookup('env', 'UPTIMEROBOT_APIKEY') }}"
12
11
tasks :
13
12
14
13
- name : Getting info about WAR file
Original file line number Diff line number Diff line change
1
+ $ANSIBLE_VAULT;1.1;AES256
2
+ 37633135383264346165663932623034666631326537333763313133613037636239656538626166
3
+ 3732393862613738613264323061663336303036363033370a366133636534326133316362623962
4
+ 33323763643562343338616336663537663134646661326364313232643961366461353365353231
5
+ 3237623430313338640a666432323135643761643933613862356265346264313436333266626135
6
+ 63643432336631306333643465393565643933613333303261303034343839343234366663626263
7
+ 64323834626533393366623037623132646563623737616535303832313836666136363362323236
8
+ 65316538646331653366313762313835346462366164366336313066343131643763313639616639
9
+ 63363164393233613437373261383030326363656263313934663839623838343437316336623730
10
+ 33353035373939373231303066373537366432643335336230373361656533633634646166356639
11
+ 34613361346436663238383964383466333366646566393431656236356537366363336564646564
12
+ 63316232643163363834623835346361343761393836306364313239336137393133396166646438
13
+ 62613262623266626364613234353538636639666239343634616362626666383433356432376238
14
+ 6432
Original file line number Diff line number Diff line change @@ -14,10 +14,11 @@ CURRENT_DIR="$(dirname "${0:-.}")"
14
14
INVENTORY=" $CURRENT_DIR /ansible/mystamps.inventory"
15
15
PLAYBOOK=" $CURRENT_DIR /ansible/deploy.yml"
16
16
PRIVATE_KEY=" $CURRENT_DIR /ansible/mystamps_rsa"
17
+ VARS_FILE=" $CURRENT_DIR /ansible/prod_vars.yml"
17
18
PASS_FILE=" $CURRENT_DIR /vault-pass.txt"
18
19
19
20
cleanup () {
20
- rm -f " $PRIVATE_KEY " " $PASS_FILE "
21
+ rm -f " $PRIVATE_KEY " " $PASS_FILE " " $VARS_FILE "
21
22
exit
22
23
}
23
24
trap ' cleanup' EXIT SIGHUP SIGINT SIGTERM
@@ -35,15 +36,17 @@ if [ -z "${VAULT_PASSWORD:-}" ]; then
35
36
exit 1
36
37
fi
37
38
38
- # Decrypt private key
39
39
echo -n " $VAULT_PASSWORD " > " $PASS_FILE "
40
40
41
- ansible-vault decrypt \
42
- --vault-password-file " $PASS_FILE " \
43
- --output " $PRIVATE_KEY " \
44
- " ${PRIVATE_KEY} .enc"
45
-
46
- chmod 600 " $PRIVATE_KEY "
41
+ for FILE in " $PRIVATE_KEY " " $VARS_FILE " ; do
42
+ FILENAME=" $( basename " $FILE " ) "
43
+ echo " Decrypting ${FILENAME} .enc to $FILENAME "
44
+ ansible-vault decrypt \
45
+ --vault-password-file " $PASS_FILE " \
46
+ --output " $FILE " \
47
+ " ${FILE} .enc"
48
+ chmod 600 " $FILE "
49
+ done
47
50
48
51
ansible-playbook \
49
52
--inventory=" $INVENTORY " \
You can’t perform that action at this time.
0 commit comments