Comment on Automate Generating WireGuard Config without Managing Existing Installation
rambos@lemm.ee 1 year ago
Creating a new client should be possible without messing up existing one. There are some options for managing clients using GUI like pivpn. I personally use OMV with wireguard extension
Skyline@lemmy.cafe 1 year ago
Sure, it’s possible. I could do it by hand, but the more clients you want to add, the more cumbersome the process. What I’d like is a tool to automate what is mostly a templating process.
aard@kyu.de 1 year ago
This should be trivially scriptable by ansible. Ideally you’d also transform your existing configuration into an ansible data structure so it can write out the complete config as that way is just more reliably - but ansible also is capable of editing stuff in place.
I’m using a structure like this:
To set up both server and client. I’m mostly adding other peoples systems, so I don’t know the private keys, and receive the public ones from them - but if you control both it’s also trivial to pull that information from the system you’re generating it on, and reuse it later.
This is the template used for the wireguard configuration, this the task managing the wireguard setup.