From 66276c543f1130b5c9903c2fc68ec788382ac890 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 8 Jun 2022 21:49:38 +0200 Subject: [PATCH] add standalone vault script --- Readme.md | 11 +++++++++++ vault/standalone_vault.sh | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..89a20e4 --- /dev/null +++ b/Readme.md @@ -0,0 +1,11 @@ +# homelab + + +## rebuild +to rebuild from scratch ansible need a vault server up and unseal +you can rebuild a standalone vault srver with a consul database snaphot with + +``` +make vault-dev FILE=./yourconsulsnaphot.snap +``` + diff --git a/vault/standalone_vault.sh b/vault/standalone_vault.sh index cd1757c..f11203b 100755 --- a/vault/standalone_vault.sh +++ b/vault/standalone_vault.sh @@ -1,5 +1,5 @@ CONSUL_HTTP_ADDR=http://127.0.0.1:8500 - +ANSIBLE_POLICY="ansible" echo "launch consul dev server" nohup consul agent -dev & if [ "$1" ]; then @@ -27,4 +27,5 @@ ui= true EOF echo "starting vault server please unseal before use " -vault server -config "/tmp/standalone-vault-dev.hcl" +nohup vault server -config "/tmp/standalone-vault-dev.hcl" & +vault token create -policy=$ANSIBLE_POLICY -display-name=rebuild-token