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"
17 dhparam
="${1}_ca/pki/dh.pem"
19 # reuse any extant quagga password
20 for v
in "${1}"/group_vars
/*vpcaccess
*
22 if [ -n "${quagga_password}" ]
24 echo "found multiple potential quagga passwords; the chosen one may not be correct" 1>&2
26 quagga_password
=$(awk '/QUAGGA_PASSWORD:/{print $2}' "${v}")
28 if [ -n "${quagga_key}" ]
30 echo "found multiple potential quagga keys; the chosen one may not be correct" 1>&2
33 if [ -z "${quagga_password}" ]
35 quagga_password
=$(pwgen -y 16)
37 if [ -z "${quagga_key}" ]
39 quagga_key
=$(pwgen -y 16)
43 sed -n '/-----BEGIN /,/-----END /p' "$@"
51 QUAGGA_PASSWORD: ${quagga_password}
52 QUAGGA_KEY: ${quagga_key}
55 $(indent "${ca_cert}")
57 $(indent "${crl_pem}")
59 $(onlycert "${cert}" | indent)
63 $(indent "${ta_secret}")
65 $(onlycert "${dhparam}" | indent)