2021-10-12 19:24:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-01-27 10:08:00 +00:00
|
|
|
vault_file="vault-secrets.txt"
|
2021-10-12 19:24:31 +00:00
|
|
|
|
2023-06-19 13:45:13 +00:00
|
|
|
juju run -a vault -- sudo systemctl restart vault
|
|
|
|
|
2024-01-09 14:19:41 +00:00
|
|
|
IPS=$(juju status --format json | jq -r '.applications.vault.units | to_entries[].value."public-address"')
|
2021-10-12 19:24:31 +00:00
|
|
|
|
|
|
|
for ip in $IPS
|
|
|
|
do
|
|
|
|
echo export VAULT_ADDR=http://${ip}:8200;
|
|
|
|
export VAULT_ADDR=http://${ip}:8200;
|
2022-01-27 10:08:00 +00:00
|
|
|
for vault_key in $(head -n3 ${vault_file} | awk '{print $4}');do
|
2021-10-12 19:24:31 +00:00
|
|
|
echo vault operator unseal -tls-skip-verify $vault_key
|
|
|
|
vault operator unseal -tls-skip-verify $vault_key
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|