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/manifests | |
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/manifests')
-rw-r--r-- | modules/profile/manifests/wireguard.pp | 11 |
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": |