Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit d155961

Browse files
committed
Update configsets to register vault
1 parent 7e3d1b6 commit d155961

File tree

2 files changed

+22
-51
lines changed

2 files changed

+22
-51
lines changed

scripts/vault-bootstrap.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

templates/quickstart-hashicorp-vault.template

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"EmailAddress": {
7272
"Type": "String",
7373
"Description": "Email Address for SNS Topic. Alarms for Vault instance memory utilzation",
74-
"Default": "[email protected]",
74+
"Default": "[email protected]"
7575
},
7676
"PrivateSubnet1ID": {
7777
"Description": "ID of the private subnet 1 in Availability Zone 1 (e.g., subnet-xxxxxxxx)",
@@ -343,14 +343,14 @@
343343
"/usr/local/bin": "https://releases.hashicorp.com/vault/0.6.1/vault_0.6.1_linux_amd64.zip"
344344
},
345345
"files": {
346-
"/tmp/vault.hcl.template": {
347-
"source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault/vault.hcl",
346+
"/etc/vault.d/vault.hcl": {
347+
"source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault.hcl",
348348
"mode": "000700",
349349
"owner": "root",
350350
"group": "root"
351351
},
352352
"/etc/init/vault-upstart.conf": {
353-
"source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault/vault-upstart.conf",
353+
"source": "https://s3.amazonaws.com/quickstart-reference/hashicorp/vault/latest/scripts/vault-upstart.conf",
354354
"mode": "000700",
355355
"owner": "root",
356356
"group": "root"
@@ -364,9 +364,11 @@
364364
},
365365
"run_vault": {
366366
"commands": {
367-
"01_run_vault_binary": {
368-
"command": "vault server -config /etc/vault.d/vault.hcl",
369-
"cwd": "/usr/local/bin/"
367+
"01_register_vault_binary": {
368+
"command": "chmod 755 vault",
369+
"command": "update-rc.d vault defaults",
370+
"command": "update-rc.d vault enable",
371+
"cwd": "/etc/init.d/"
370372
}
371373
}
372374
}
@@ -430,7 +432,10 @@
430432
{
431433
"Ref": "ConsulMasterPrivateIP"
432434
},"\"\n",
433-
"sed -e /tmp/vault.hcl.template sed -e s/__CONSULMASTER__/${CONSULMASTER}/ >/etc/vault.d/vault.hcl",
435+
"sed -i -e s/__CONSULMASTER__/${CONSULMASTER}/ /etc/vault.d/vault.hcl",
436+
"\n",
437+
"echo \"Starting Vault Server \" \n",
438+
"vault server -config /etc/vault.d/vault.hcl",
434439
"\n",
435440
"/usr/local/bin/cfn-signal -e $? ",
436441
" --stack ", {
@@ -565,10 +570,11 @@
565570
},
566571
"run_vault": {
567572
"commands": {
568-
"01_run_vault_binary": {
569-
"command": "vault server -config /etc/vault.d/vault.hcl",
570-
"cwd": "/usr/local/bin/"
571-
}
573+
"01_register_vault_binary": {
574+
"command": "chmod 755 vault",
575+
"command": "update-rc.d vault defaults",
576+
"command": "update-rc.d vault enable",
577+
"cwd": "/etc/init.d/" }
572578
}
573579
}
574580
}
@@ -631,7 +637,10 @@
631637
{
632638
"Ref": "ConsulMasterPrivateIP"
633639
},"\"\n",
634-
"sed -e /tmp/vault.hcl.template sed -e s/__CONSULMASTER__/${CONSULMASTER}/ >/etc/vault.d/vault.hcl",
640+
"sed -i -e s/__CONSULMASTER__/${CONSULMASTER}/ /etc/vault.d/vault.hcl",
641+
"\n",
642+
"echo \"Starting Vault Server \" \n",
643+
"vault server -config /etc/vault.d/vault.hcl",
635644
"\n",
636645
"/usr/local/bin/cfn-signal -e $? ",
637646
" --stack ", {

0 commit comments

Comments
 (0)