Compare commits
8 Commits
78d0aa9e0a
...
ansible
| Author | SHA1 | Date | |
|---|---|---|---|
|
3ab9170c8f
|
|||
|
875304f58b
|
|||
| 5bc955d5ef | |||
|
49f91ac87f
|
|||
|
3494008084
|
|||
| 7497629b6d | |||
| a830ad508c | |||
|
4db6fa5078
|
2
Makefile
2
Makefile
@@ -13,7 +13,9 @@ include wg.mk
|
||||
.PHONY: check
|
||||
check: ## Check you have all dependencies
|
||||
@command -v graph-easy >/dev/null || { echo "Install perl-graph-easy" && exit 1 ;}
|
||||
@command -v ansible >/dev/null || { echo "Install ansible" && exit 1 ;}
|
||||
@command -v recsel >/dev/null || { echo "Install recutils" && exit 1 ;}
|
||||
@command -v wg >/dev/null || { echo "Install wireguard" && exit 1 ;}
|
||||
@command -v lowdown >/dev/null || { echo "Install lowdown" && exit 1 ;}
|
||||
@echo "All dependencies installed"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ all:
|
||||
|
||||
wireguard:
|
||||
hosts:
|
||||
192.168.0.93:
|
||||
192.168.10.93:
|
||||
arch:
|
||||
hosts:
|
||||
10.0.0.1:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Install Wireguard on Server
|
||||
hosts: wireguard
|
||||
become: true
|
||||
user: root
|
||||
|
||||
tasks:
|
||||
- name: Install wireguard tools and dig
|
||||
@@ -14,6 +14,7 @@
|
||||
ansible.builtin.copy:
|
||||
src: wireguard/wg0.conf
|
||||
dest: /etc/wireguard/wg0.conf
|
||||
notify: Reload systemd daemon
|
||||
|
||||
- name: Get server public IP
|
||||
ansible.builtin.command: dig +short myip.opendns.com @resolver1.opendns.com
|
||||
@@ -30,3 +31,8 @@
|
||||
name: wg-quick@wg0
|
||||
enabled: yes
|
||||
|
||||
handlers:
|
||||
- name: Reload systemd daemon
|
||||
ansible.builtin.command:
|
||||
cmd: systemctl daemon-reload
|
||||
|
||||
|
||||
@@ -10,3 +10,10 @@ id: 2
|
||||
name: Malin Freeborn
|
||||
pubkey: loNnXRalD0ZyOLadSWm31rqOuRfEbgtX9O4/z7eSIho=
|
||||
|
||||
id: 3
|
||||
name: coja
|
||||
pubkey: snfw8r1hIAtTABGd7K9xIZ9RH62qMEK4fRqVm4EbniQ=
|
||||
|
||||
id: 4
|
||||
name: netstat
|
||||
pubkey: Z8bk25hHo6oadOX7KtoLUDXGW9r+thMiR320aiGmQAQ=
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
# Client configuration for wireguard to nimbus at xecut.
|
||||
|
||||
[Interface]
|
||||
Address = 10.0.0.2/32
|
||||
Address = 10.0.0.{{id}}/32
|
||||
PrivateKey = PRIVATE_KEY
|
||||
DNS = 9.9.9.9
|
||||
|
||||
[Peer]
|
||||
PublicKey = GH+qA1Au9BraGhNt7Aqp8tdhGVfH8ENnY3VzKhe69XQ=
|
||||
Endpoint = space.xecut.me:51900
|
||||
AllowedIPs = 10.0.0.{{id}}/24
|
||||
AllowedIPs = 10.0.0.1/24
|
||||
|
||||
|
||||
Reference in New Issue
Block a user