9 lines
263 B
Bash
9 lines
263 B
Bash
|
cd host_vars
|
||
|
for i in node01 node02 node03
|
||
|
do
|
||
|
sed -i "s#^wg_private_key.*#wg_private_key: $(wg genkey)#" ${i}.yaml
|
||
|
pubkey=$(cat ${i}.yaml | yq .wg_private_key | sed 's/"//g' | wg pubkey)
|
||
|
sed -i "s#^wg_public_key.*#wg_public_key: ${pubkey}#" ${i}.yaml
|
||
|
done
|
||
|
|