homeassistant and wireguard updates
This commit is contained in:
+1
-32
@@ -31,37 +31,6 @@
|
||||
- /etc/wireguard/clients
|
||||
- /etc/wireguard/keys
|
||||
|
||||
- name: Generate key generation script
|
||||
copy:
|
||||
dest: /etc/wireguard/generate_key.sh
|
||||
mode: "0700"
|
||||
content: |
|
||||
#!/bin/bash
|
||||
# Generate a WireGuard keypair
|
||||
# Usage: ./generate_key.sh <output_prefix>
|
||||
|
||||
OUTPUT_PREFIX="$1"
|
||||
|
||||
if [ -z "$OUTPUT_PREFIX" ]; then
|
||||
echo "Usage: $0 <output_file_prefix>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Generating WireGuard keypair..."
|
||||
umask 077
|
||||
wg genkey | tee "${OUTPUT_PREFIX}.key" | wg pubkey > "${OUTPUT_PREFIX}.pub"
|
||||
chmod 600 "${OUTPUT_PREFIX}.key"
|
||||
chmod 644 "${OUTPUT_PREFIX}.pub"
|
||||
echo "Keys generated: ${OUTPUT_PREFIX}.key and ${OUTPUT_PREFIX}.pub"
|
||||
|
||||
- name: Deploy add_client.sh script
|
||||
copy:
|
||||
src: wireguard/add_client.sh
|
||||
dest: /etc/wireguard/add_client.sh
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create server private key file
|
||||
copy:
|
||||
content: "{{ wireguard_server.private_key }}"
|
||||
@@ -138,7 +107,7 @@
|
||||
iptables:
|
||||
table: nat
|
||||
chain: POSTROUTING
|
||||
out_interface: "{{ ansible_default_ipv4.interface }}"
|
||||
out_interface: "enp2s0"
|
||||
source: 10.8.0.0/24
|
||||
jump: MASQUERADE
|
||||
comment: WireGuard masquerading
|
||||
|
||||
Reference in New Issue
Block a user