fix: пересборка output/index.html при uninstall с LIMIT

Второй play перенесён на hysteria2_servers с run_once на localhost,
чтобы LIMIT не пропускал пересборку. Пустой index.html удаляется.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Sergey Antropoff
2026-07-01 13:31:28 +03:00
parent 13af9e814c
commit 56ccf6ed39
4 changed files with 24 additions and 11 deletions
+8 -1
View File
@@ -56,6 +56,13 @@
when: hysteria2_global_servers | default([]) | length > 0
become: false
- name: Remove global HTML index when no servers remain
ansible.builtin.file:
path: "{{ hysteria2_output_dir }}/index.html"
state: absent
when: hysteria2_global_servers | default([]) | length == 0
become: false
- name: Open global index in default browser (macOS)
ansible.builtin.command:
cmd: open "{{ hysteria2_output_dir }}/index.html"
@@ -87,6 +94,6 @@
- name: Skip global index when no servers exported
ansible.builtin.debug:
msg: "Глобальный index.html не создан — нет server-info.yml в {{ hysteria2_output_dir }}/"
msg: "Глобальный {{ hysteria2_output_dir }}/index.html удалён — нет server-info.yml в output/"
when: hysteria2_global_servers | default([]) | length == 0
become: false
+1 -1
View File
@@ -127,5 +127,5 @@
Hysteria2 (Salamander) полностью удалён с {{ inventory_hostname }}.
Локальная папка {{ hysteria2_output_dir }}/{{ hysteria2_output_name }}/ удалена.
{% if hysteria2_uninstall_rebuild_global_index | default(true) | bool %}
Глобальный {{ hysteria2_output_dir }}/index.html будет пересобран.
{{ hysteria2_output_dir }}/index.html будет пересобран без этого сервера.
{% endif %}