Files
Gabenov Stanislav a6d2623802 vpn
2026-02-09 20:42:24 +03:00

54 lines
1.6 KiB
YAML

---
- name: Populate service facts
ansible.builtin.service_facts:
- name: Enable BBR
include_tasks: bbr.yml
- name: Install docker
include_tasks: install_docker.yml
when: ansible_facts.services['docker'] is undefined
- name: Install/update yq
include_tasks: install_yq.yml
- name: Security block
block:
- name: Edit SSHD config
include_tasks: ssh.yml
- name: Edit iptables
include_tasks: iptables.yml
- name: Add user
include_tasks: user.yml
when: configure_security|default(false)|bool == true
- name: Generate values
block:
- name: Generate x25519 PIK
shell:
cmd: docker run --rm ghcr.io/xtls/xray-core x25519 | head -n1 | cut -d' ' -f 3
register: x25519_pik
- name: Generate x25519 PBK
shell:
cmd: docker run --rm ghcr.io/xtls/xray-core x25519 -i {{ x25519_pik.stdout }} | tail -1 | cut -d' ' -f 3
register: x25519_pbk
- name: Generate SID
shell:
cmd: openssl rand -hex 8
register: short_id
- name: Generate default user
shell:
cmd: docker run --rm ghcr.io/xtls/xray-core uuid
register: xray_uuid
- name: Install marzban
include_tasks: install_marzban.yml
when: setup_variant == "marzban"
- name: Install xray
include_tasks: install_xray.yml
when: setup_variant == "xray"
- name: Install warp
include_tasks: setup_warp.yml
when: setup_warp|default(false)|bool == true
- name: Start proxy
community.docker.docker_compose_v2:
project_src: /opt/xray-vps-setup
files:
- docker-compose.yml
- name: End xray
include_tasks: end_xray.yml
when: setup_variant == "xray"