Wireguard mesh network with Ansible
| group_vars | ||
| .gitignore | ||
| ansible.cfg | ||
| inventory.yaml | ||
| playbook.yaml | ||
| README.md | ||
| requirements.txt | ||
| wg-extra-peer.conf.j2 | ||
wg-mesh
This playbook can create a Wireguard mesh network to connect multiple servers with P2P way.
Vars
An example inventory.yaml is attached. Here you can configure the servers and subnets. In group_vars/all.yaml you can configure clients. These connect to servers P2P but not to each other. This needed to let to access the entire infra on my laptop over VPN.
Usage
After this repo cloned I suggest to use Python venv. Install python3-venv on Debian or use other commands to install venv. Run the following.
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
ansible-playbook playbook.yaml -K
Type the become password and process will start. On every server wg-mesh will be configured and in output folder you can use the client configs. Do not forget to generate private key and public key for the clients before playbook run.