summaryrefslogtreecommitdiffstats
path: root/roles/wireguard/README.md
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-08-31 17:19:26 +0200
committerAhmed Abdelhalim <[email protected]>2025-08-31 17:19:26 +0200
commit81b1c69c18a24805fc2811b86fddbafbf728ea02 (patch)
tree052b7a950bc9c56c15ef21c5641508615607f148 /roles/wireguard/README.md
parente700812dad60ee8b2b3345bf821640450f4f53cd (diff)
Add wireguard role readme
Diffstat (limited to 'roles/wireguard/README.md')
-rw-r--r--roles/wireguard/README.md53
1 files changed, 53 insertions, 0 deletions
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