Initial commit: Ansible role for Hysteria2 VPN server deployment.

Includes install/update/uninstall playbooks, Makefile, vault-based SSH credentials, per-server and global HTML export with QR codes.
This commit is contained in:
2026-07-01 02:02:58 +03:00
commit df19816039
28 changed files with 2027 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
---
- name: Update system and install dependencies
when: hysteria2_upgrade_system | bool
block:
- name: apt update
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
- name: apt upgrade
ansible.builtin.apt:
upgrade: dist
- name: Install curl, micro, pwgen and qrencode
ansible.builtin.apt:
name: "{{ _hysteria2_apt_packages }}"
state: present
update_cache: "{{ not (hysteria2_upgrade_system | bool) }}"
vars:
_hysteria2_apt_packages: >-
{{
['curl', 'micro', 'pwgen']
+ (['qrencode'] if hysteria2_generate_qr_png | bool else [])
}}
- name: Install Hysteria2 via official script
ansible.builtin.shell:
cmd: bash <(curl -fsSL https://get.hy2.sh/)
executable: /bin/bash
args:
creates: /usr/local/bin/hysteria
register: _hysteria2_install
- name: Show Hysteria2 install result
ansible.builtin.debug:
msg: "{{ _hysteria2_install.stdout_lines | default(['Hysteria2 already installed']) }}"
when: _hysteria2_install.stdout_lines is defined