diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-17 12:51:55 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-17 13:35:51 +0200 |
commit | cfad76106ad85e170c08a196e7e365a78293aa7c (patch) | |
tree | 36d0fb65f63b9bb36ba465ca6e1459aff4b2ad60 /modules/profile/templates | |
parent | a7b985dd3cc4af68875733eb135335a31504f472 (diff) | |
download | Puppet-cfad76106ad85e170c08a196e7e365a78293aa7c.tar.gz Puppet-cfad76106ad85e170c08a196e7e365a78293aa7c.tar.zst Puppet-cfad76106ad85e170c08a196e7e365a78293aa7c.zip |
Add wireguard to host_ldap
Diffstat (limited to 'modules/profile/templates')
-rw-r--r-- | modules/profile/templates/wireguard/network.conf.erb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/profile/templates/wireguard/network.conf.erb b/modules/profile/templates/wireguard/network.conf.erb index 0528050..5327dfd 100644 --- a/modules/profile/templates/wireguard/network.conf.erb +++ b/modules/profile/templates/wireguard/network.conf.erb | |||
@@ -1,13 +1,19 @@ | |||
1 | [Interface] | 1 | [Interface] |
2 | <%- @ips.each do |ip| %> | 2 | <%- @ips.each do |ip| -%> |
3 | Address = <%= ip %> | 3 | Address = <%= ip %> |
4 | <% end -%> | 4 | <%- end -%> |
5 | PrivateKey = <%= @private_key %> | 5 | PrivateKey = <%= @private_key %> |
6 | ListenPort = 51820 | ||
6 | 7 | ||
7 | <%- @facts["ldapvar"]["other"].each do |host| -%> | 8 | <%- @facts["ldapvar"]["other"].each do |host| -%> |
8 | <%- if (host["vars"]["wireguard_public"] || []).count > 0 %> | 9 | <%- if (host["vars"]["wireguard_public"] || []).count > 0 %> |
9 | [Peer] | 10 | [Peer] |
10 | PublicKey = host["vars"]["wireguard_public"][0] | 11 | # <%= host["vars"]["real_hostname"][0] %> |
12 | PublicKey = <%= host["vars"]["wireguard_public"][0] %> | ||
13 | <%- if (host["vars"]["wireguard_ip"] || []).count > 0 -%> | ||
14 | AllowedIps = <%= host["vars"]["wireguard_ip"].join(", ").gsub /\/\d+/, "/32" %> | ||
15 | <%- end -%> | ||
16 | Endpoint = <%= host["vars"]["real_hostname"][0] %>:51820 | ||
11 | 17 | ||
12 | <% end -%> | 18 | <% end -%> |
13 | <%- end -%> | 19 | <%- end -%> |