Files
michaelschiemer/ansible/wireguard-server/site.yml
Michael Schiemer 55a330b223 Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
2025-08-11 20:13:26 +02:00

79 lines
2.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- name: WireGuard VPN Server Setup (ohne Firewall)
hosts: vpn
become: true
gather_facts: true
pre_tasks:
- name: Update package cache
apt:
update_cache: true
cache_valid_time: 3600
- name: Zeige Setup-Information
debug:
msg: |
🌐 WireGuard-Installation OHNE Firewall
✅ Server bleibt öffentlich erreichbar
✅ WireGuard als zusätzlicher VPN-Zugang
✅ Keine SSH-Beschränkungen
roles:
- role: wireguard
post_tasks:
- name: Prüfe ob qrencode installiert ist
command: which qrencode
register: qrencode_check
ignore_errors: true
changed_when: false
- name: Installiere qrencode für QR-Codes
apt:
name: qrencode
state: present
when: qrencode_check.rc != 0
- name: Erstelle QR-Codes für mobile Clients
shell: qrencode -t ansiutf8 < /etc/wireguard/clients/{{ item.name }}.conf
loop: "{{ wireguard_clients }}"
register: qr_codes
when: item.name is search('phone|mobile')
ignore_errors: true
- name: Zeige QR-Codes
debug:
msg: |
QR-Code für {{ item.item.name }}:
{{ item.stdout }}
loop: "{{ qr_codes.results }}"
when: item.stdout is defined and not item.failed
- name: Zeige WireGuard-Status
command: wg show
register: wg_status
changed_when: false
- name: WireGuard-Status anzeigen
debug:
var: wg_status.stdout_lines
- name: Zeige finale Setup-Information
debug:
msg: |
🎉 WireGuard erfolgreich installiert!
Server-Zugang:
📡 Öffentlich: ssh root@{{ wireguard_server_ip }}
🔒 Via VPN: ssh root@{{ wireguard_address.split('/')[0] }} (nach VPN-Verbindung)
Client-Konfigurationen:
📂 Server-Pfad: /etc/wireguard/clients/
💾 Download: make download-configs
📱 QR-Codes: make qr-codes
Nützliche Befehle:
🔍 Status: make status
📋 Logs: make logs
Client hinzufügen: make add-client