8 echo "usage: $(basename "$0") environment region"
12 ca_cert
="${1}_ca/pki/ca.crt"
13 crl_pem
="${1}_ca/pki/crl.pem"
14 cert
="${1}_ca/pki/issued/${2}.${1}.crt"
15 key
="${1}_ca/pki/private/${2}.${1}.key"
16 ta_secret
="${1}_ca/pki/ta.key"
18 # reuse any extant quagga password
19 for v
in "${1}"/group_vars
/*vpcaccess
*
21 if [ -n "${quagga_password}" ]
23 echo "found multiple potential quagga passwords; the chosen one may not be correct" 1>&2
25 quagga_password
=$(awk '/QUAGGA_PASSWORD:/{print $2}' "${v}")
27 if [ -z "${quagga_password}" ]
29 quagga_password
=$(pwgen -y 16)
33 sed -n '/-----BEGIN /,/-----END /p' "$@"
41 QUAGGA_PASSWORD: "${quagga_password}"
44 $(indent "${ca_cert}")
46 $(indent "${crl_pem}")
48 $(onlycert "${cert}" | indent)
52 $(indent "${ta_secret}")