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

18 lines
461 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: |
${wg_server_own_privatekey}
- path: "/etc/wireguard/wg0-peers.conf"
owner: "root:root"
permissions: "0644"
content: |
%{~ for index, pubkey in wg_server_peer_publickeys ~}
[Peer]
PublicKey = ${pubkey}
AllowedIPs = 10.10.10.${index+2}/32, fd10:10:10::${index+2}/128
%{~ endfor ~}