k8s-playground/setup/generate-keys.sh

8 lines
411 B
Bash
Raw Normal View History

2019-05-22 11:37:13 +00:00
cd host_vars
2019-05-30 11:37:13 +00:00
for i in cluster-frontend cluster-control01 cluster-control02 cluster-control03 cluster-worker01 cluster-worker02 cluster-worker03 cluster-worker04 cluster-worker05 cluster-worker06
2019-05-22 11:37:13 +00:00
do
sed -i "s#^wg_secret_key.*#wg_secret_key: $(wg genkey)#" ${i}.yaml
pubkey=$(cat ${i}.yaml | yq .wg_secret_key | sed 's/"//g' | wg pubkey)
sed -i "s#^wg_public_key.*#wg_public_key: ${pubkey}#" ${i}.yaml
done