k8s-playground/setup/generate-keys.sh
2019-05-22 13:37:13 +02:00

7 lines
391 B
Bash
Executable file

cd host_vars
for i in cluster-master01 cluster-master02 cluster-master03 cluster-worker01 cluster-worker02 cluster-worker03 cluster-worker04 cluster-worker05 cluster-worker06
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