wireguard-setup/terraform/templates/user-data.tpl

18 lines
463 B
Smarty
Raw Normal View History

2020-01-30 21:33:16 +01:00
#cloud-config
write_files:
- path: "/etc/wireguard/wg0-privatekey"
owner: "root:root"
permissions: "0600"
content: |
2021-06-14 22:51:25 +02:00
${wg_server_wg_privatekey}
2020-01-30 21:33:16 +01:00
- path: "/etc/wireguard/wg0-peers.conf"
owner: "root:root"
permissions: "0644"
content: |
2021-06-14 22:51:25 +02:00
%{~ for index, pubkey in wg_server_wg_peer_publickeys ~}
2020-01-30 21:33:16 +01:00
[Peer]
PublicKey = ${pubkey}
AllowedIPs = 10.10.10.${index+2}/32, fd10:10:10::${index+2}/128
%{~ endfor ~}