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