From 81b1c69c18a24805fc2811b86fddbafbf728ea02 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 31 Aug 2025 17:19:26 +0200 Subject: Add wireguard role readme --- roles/wireguard/README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 roles/wireguard/README.md diff --git a/roles/wireguard/README.md b/roles/wireguard/README.md new file mode 100644 index 00000000..7ce5fbe1 --- /dev/null +++ b/roles/wireguard/README.md @@ -0,0 +1,53 @@ +# Ansible Role: wireguard + +This role configures WireGuard VPN connections on the target host. + +## Role Variables + +- `wireguard_connections` a dictionary of WireGuard connection configurations (default: `{}`). +- `wireguard_autostart_connection` the name of the connection to automatically start on boot (default: `""`). + +## Example Configuration + +```yaml +wireguard_connections: + protonvpn-ch-1: | + [Interface] + PrivateKey = your_private_key_here + Address = 10.2.0.2/32 + DNS = 10.2.0.1 + + [Peer] + PublicKey = server_public_key_here + AllowedIPs = 0.0.0.0/0 + Endpoint = server.endpoint:51820 + +wireguard_autostart_connection: "protonvpn-ch-1" +``` + +## Dependencies + +This role requires: + +- WireGuard kernel module support +- systemd for service management + +## Usage + +1. Define your WireGuard connection configurations in `wireguard_connections` +1. Optionally set `wireguard_autostart_connection` to auto-start a connection on boot +1. Run the role to deploy configurations and manage services + +The role will: + +- Install WireGuard packages +- Create configuration files in `/etc/wireguard/` +- Stop all existing connections +- Enable and start the autostart connection (if configured) + +## Notes + +- Configuration files are backed up before being overwritten +- Only one connection can be set to autostart +- All connections are stopped before starting the autostart connection +- If no autostart connection is configured, no connections will be automatically started -- cgit v1.2.3