host_key_checking = False
inventory = inventory
remote_user = ec2-user
-private_key_file = keys/management.pem
+private_key_file = keys/management
#!/bin/sh
set -e
+set -o pipefail
if [ $# -ne 2 ]
then
key="${1}_ca/pki/private/${2}.${1}.key"
ta_secret="${1}_ca/pki/ta.key"
+# reuse any extant quagga password
+for v in "${1}"/group_vars/*vpcaccess*
+do
+ if [ -n "${quagga_password}" ]
+ then
+ echo "found multiple potential quagga passwords; the chosen one may not be correct" 1>&2
+ fi
+ quagga_password=$(awk '/QUAGGA_PASSWORD:/{print $2}' "${v}")
+done
+if [ -z "${quagga_password}" ]
+then
+ quagga_password=$(pwgen -y 16)
+fi
+
function onlycert(){
sed -n '/-----BEGIN /,/-----END /p' "$@"
}
cat<<EOF
---
-QUAGGA_PASSWORD: $(pwgen -y 16)
+QUAGGA_PASSWORD: "${quagga_password}"
ca_name: $1
ca_cert: |
$(indent "${ca_cert}")