vault-tls.sh.tmpl (532B)
1 #!/usr/bin/env sh 2 # 3 # Script to replace bao API certificates 4 # 5 # Run with bao API domain name as first parameter. 6 # Example: ./vault-tls.sh vault.example.com 7 8 set -o errexit 9 set -o nounset 10 set -o xtrace 11 12 {{- $host := env "node.unique.name" }} 13 14 # copy certificate files 15 sudo cp -f /etc/letsencrypt/live/$1/fullchain.pem /etc/openbao/tls/{{ $host }}.pem 16 sudo cp -f /etc/letsencrypt/live/$1/privkey.pem /etc/openbao/tls/{{ $host }}.key 17 18 # change ownership for bao 19 sudo chown openbao: /etc/openbao/tls/{{ $host }}* 20 21 sudo pkill -HUP bao