Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yayuniversal/wireguard-ansible-role
Ansible role to install WireGuard and configure an interface
https://github.com/yayuniversal/wireguard-ansible-role
ansible ansible-role wireguard wireguard-tunnel
Last synced: about 1 month ago
JSON representation
Ansible role to install WireGuard and configure an interface
- Host: GitHub
- URL: https://github.com/yayuniversal/wireguard-ansible-role
- Owner: yayuniversal
- License: mit
- Created: 2023-06-09T01:50:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-10T03:46:12.000Z (11 months ago)
- Last Synced: 2024-11-11T01:33:53.230Z (3 months ago)
- Topics: ansible, ansible-role, wireguard, wireguard-tunnel
- Language: Jinja
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
WireGuard Ansible Role
=========================An Ansible role to install WireGuard and configure an interface. Works on Debian-based distributions.
Requirements
------------None
Role Variables
--------------```yaml
# Private key. If empty (default), a new private key will be generated and saved on the server.
# It will be reused next time for the same interface if the file exists.
wireguard_private_key:# Interface name
wireguard_interface_name: wg0# IP address
wireguard_ip_address: 10.0.0.1/24# Listen port
wireguard_listen_port: 51820# DNS (omitted by default)
wireguard_dns:# MTU (omitted by default)
wireguard_mtu:# PreUp, PostUp, PreDown and PostDown scripts (omitted by default)
wireguard_preup:
wireguard_postup:
wireguard_predown:
wireguard_postdown:# Peers, empty by default
wireguard_peers:
- public_key:
allowed_ips:
endpoint: # Optional, domain names can also used
keepalive: # Optional, used to keep NAT port mappings alive
psk: # Optional
```Dependencies
------------None
Example Playbook
----------------```yaml
- hosts: servers
roles:
- role: wireguard
vars:
wireguard_interface_name: wg0
wireguard_ip_address: 10.0.0.1/24
wireguard_listen_port: 51820
wireguard_peers:
- public_key: fK9L5i9Y/atI2qs7JGjMK2Ab6nccl/rrx+sUA11Zrgo=
allowed_ips: 10.0.0.2/32
endpoint: example.com:51820
- public_key: VT9WaisSQbwELinfBcIlGbFWtahePZyT92TgsIXX52M=
allowed_ips: 10.0.0.3/32
```License
-------MIT