aboutsummaryrefslogtreecommitdiff
path: root/modules/profile/manifests/wireguard.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/profile/manifests/wireguard.pp')
-rw-r--r--modules/profile/manifests/wireguard.pp11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/profile/manifests/wireguard.pp b/modules/profile/manifests/wireguard.pp
index ad1b081..829f82d 100644
--- a/modules/profile/manifests/wireguard.pp
+++ b/modules/profile/manifests/wireguard.pp
@@ -14,11 +14,22 @@ class profile::wireguard (
14 14
15 $private_key = generate_password(32, $password_seed, "wireguard", "curve25519", true) 15 $private_key = generate_password(32, $password_seed, "wireguard", "curve25519", true)
16 16
17 if file("/usr/bin/wg", "/dev/null") != "" {
18 $puppet_notifies_path = lookup("base_installation::puppet_notifies_path")
19 $public_key = generate("/usr/bin/bash", "-c", "echo $private_key | /usr/bin/wg pubkey")
20 concat::fragment { "host_ldap add wireguard":
21 target => "$puppet_notifies_path/host_ldap.info",
22 content => "puppetVar: wireguard_public=$public_key",
23 order => "00-80"
24 }
25 }
26
17 file { "/etc/wireguard/network.conf": 27 file { "/etc/wireguard/network.conf":
18 ensure => "file", 28 ensure => "file",
19 mode => "0600", 29 mode => "0600",
20 content => template("profile/wireguard/network.conf.erb"), 30 content => template("profile/wireguard/network.conf.erb"),
21 require => [Package["wireguard-tools"], Package["wireguard-dkms"]], 31 require => [Package["wireguard-tools"], Package["wireguard-dkms"]],
32 notify => Service["wg-quick@network"],
22 } 33 }
23 -> 34 ->
24 service { "wg-quick@network": 35 service { "wg-quick@network":