Configure Wireguard VPN on Ubuntu servers.
This role installs a Wireguard VPN on the remote Ubuntu server and generates client configuration files locally.
qrencode
to show configs as QR codes
All variables are defined in defaults/main.yml
name | description | default value |
---|---|---|
vpn_keys_path | Local path to VPN config files | configs/{{ vpn_server }}/wireguard |
vpn_server | VPN server real IP | {{ ansible_default_ipv4.address }} |
vpn_network | VPN subnet | 10.20.0.0/24 |
vpn_port | UDP port (Random port is generated once per host) | random(seed=inventory_hostname) |
vpn_dns_servers | DNS servers to use | 176.103.130.130 , 1.1.1.1 |
vpn_clients | A list of client configuration names | wg_{{ vpn_server }} |
force | Recreate all configs | False |
No dependencies
- hosts: servers
roles:
- { role: wormi4ok.vpn, become: yes }
docker run --rm -it \
-v "$(pwd)":/tmp/$(basename "${PWD}"):ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /tmp/$(basename "${PWD}") \
quay.io/ansible/molecule:3.0.8 \
molecule test
MIT
wormi4ok