From eac9e9da83fb26eeb43eed7ae61ad14a896671bf Mon Sep 17 00:00:00 2001 From: igor04091968 Date: Sat, 6 Jun 2026 17:34:54 +0300 Subject: [PATCH] fix(ansible): recover gateway credentials when missing --- ansible/deploy_proxmox_web_gateway.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ansible/deploy_proxmox_web_gateway.yml b/ansible/deploy_proxmox_web_gateway.yml index 195aaad..a00ebf9 100644 --- a/ansible/deploy_proxmox_web_gateway.yml +++ b/ansible/deploy_proxmox_web_gateway.yml @@ -162,7 +162,12 @@ path: "{{ proxmox_web_gateway_auth_file }}" register: proxmox_web_gateway_auth_stat - - name: Создать gateway Basic Auth credential при первом запуске + - name: Проверить наличие gateway credential файла + ansible.builtin.stat: + path: "{{ proxmox_web_gateway_credentials_file }}" + register: proxmox_web_gateway_credentials_stat + + - name: Создать согласованные gateway Basic Auth credential ansible.builtin.shell: | set -eu umask 077 @@ -172,9 +177,10 @@ printf 'url=https://{{ proxmox_web_gateway_public_hostname }}/\nuser={{ proxmox_web_gateway_auth_user }}\npassword=%s\n' "$password" > '{{ proxmox_web_gateway_credentials_file }}' args: executable: /bin/sh - creates: "{{ proxmox_web_gateway_auth_file }}" no_log: true - when: not proxmox_web_gateway_auth_stat.stat.exists + when: > + not (proxmox_web_gateway_auth_stat.stat.exists | default(false)) + or not (proxmox_web_gateway_credentials_stat.stat.exists | default(false)) - name: Зафиксировать права gateway Basic Auth файла ansible.builtin.file: