@@ -24,7 +24,7 @@ This collection will:
2424
2525## How to run Ansible playbooks from this collection
2626
27- First make sure your future destination host is up and running and you have an access to SSH Private Key file.
27+ First make sure your future destination host is up and running and you have an access to SSH Private Key file.
2828Prepare the Python prerequisites for Ansible Roles in this Collecion:
2929
3030``` bash
@@ -61,81 +61,9 @@ You may want to create a playbook to run all 3 playbooks in one run:
6161 tags : wireguard
6262` ` `
6363
64- ## Variables example
64+ ## Variables
6565
66- ` ` ` yaml
67- ---
68- # Directory to store WireGuard configuration on the remote hosts
69- wireguard_dir : /etc/wireguard
70- wireguard_clients_dir : " {{ wireguard_dir }}/clients"
71-
72- wireguard_clients_download_dir : clients/
73- wireguard_download_clients : false
74-
75- # Predefined wireguard keys, this usually should be defined in ansible-vault
76- wireguard_privatekey_path : " {{ wireguard_dir }}/privatekey"
77- wireguard_publickey_path : " {{ wireguard_dir }}/publickey"
78- wireguard_presharedkey_path : " {{ wireguard_dir }}/presharedkey"
79-
80- wireguard_systemd_path : /etc/systemd/network
81-
82- # Wireguard packages
83- wireguard_repo_url : " {{ _repo_url }}"
84- wireguard_distro_packages : " {{ _distro_packages }}"
85-
86- wireguard_packages :
87- - wireguard-dkms
88- - wireguard-tools
89-
90- # The default port WireGuard will listen if not specified otherwise.
91- wireguard_port : 51820
92-
93- # Client destination Hostname
94- wireguard_hostname : " {{ inventory_hostname }}"
95-
96- # The default interface name that wireguard should use if not specified otherwise.
97- wireguard_interface : wg0
98-
99- # Base wireguard subnet
100- wireguard_address : 10.213.213.0/24
101-
102- wireguard_server_ip : " {{ wireguard_address | ipaddr('network') | ipmath(1) }}"
103- wireguard_subnetmask : " {{ wireguard_address | ipaddr('prefix') }}"
104-
105- # XXX: This role only works with PrivateKeyFile/PresharedKeyFile it doesn't support variables.
106- wireguard_systemd_netdev :
107- - NetDev :
108- - Name : " {{ wireguard_interface }}"
109- - Kind : wireguard
110- - Description : " wireguard server: {{ wireguard_interface}} server on {{ wireguard_address }}"
111- - WireGuard :
112- - PrivateKey : " {{ _privkey_value['content'] | b64decode }}"
113- - ListenPort : " {{ wireguard_port }}"
114-
115- wireguard_systemd_network :
116- - Match :
117- - Name : " {{ wireguard_interface }}"
118- - Network :
119- - Address : " {{ wireguard_server_ip }}/{{ wireguard_subnetmask }}"
120- - Route :
121- - Destination : " {{ wireguard_address }}"
122- - Gateway : " {{ wireguard_server_ip }}"
123-
124- wireguard_keepalive : 25
125-
126- wireguard_peers_allowed_ips : " {{ ([(_wireguard_interface_addr | ipaddr('network/prefix'))] + wireguard_additional_routes) | join(\" , \" ) }}"
127- wireguard_peers : []
128- # - name: user1
129- # allowed_ip: "10.213.213.2/32"
130- # publickey: "asdasdasdadsasdasd"
131- # - name: user2
132- # allowed_ip: "10.213.213.3/32"
133- # publickey: "000000000000000000"
134- # keepalive: 30
135- # - name: user3
136- # allowed_ip: "10.213.213.4/32"
137- # publickey: "111111111111111111"
138- ```
66+ [Wireguard Role Variables](roles/wireguard/defaults/main.yml)
13967
14068## License
14169
@@ -162,4 +90,4 @@ See [LICENSE](LICENSE) for full details.
16290
16391## Author Information
16492
165- Created in 2021 by [ Labyrinth Labs] ( https://www.lablabs.io/ )
93+ Created in 2021 by [Labyrinth Labs](https://www.lablabs.io/)
0 commit comments