add keygen
This commit is contained in:
parent
e60eff7cf0
commit
94e732c767
1 changed files with 8 additions and 0 deletions
8
generate-keys.sh
Executable file
8
generate-keys.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
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
|
||||
|
Loading…
Reference in a new issue