add standalone vault script

This commit is contained in:
vincent 2022-06-08 21:49:38 +02:00
parent 4f0cbd186c
commit 66276c543f
2 changed files with 14 additions and 2 deletions

11
Readme.md Normal file
View File

@ -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
```

View File

@ -1,5 +1,5 @@
CONSUL_HTTP_ADDR=http://127.0.0.1:8500 CONSUL_HTTP_ADDR=http://127.0.0.1:8500
ANSIBLE_POLICY="ansible"
echo "launch consul dev server" echo "launch consul dev server"
nohup consul agent -dev & nohup consul agent -dev &
if [ "$1" ]; then if [ "$1" ]; then
@ -27,4 +27,5 @@ ui= true
EOF EOF
echo "starting vault server please unseal before use " 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