From ee8ade29f9a72914300b5f3d887375ba5cc9acbe Mon Sep 17 00:00:00 2001 From: spektr Date: Sun, 29 Nov 2026 06:09:14 +0100 Subject: [PATCH] =?UTF-8?q?GNAI-025:=20fluxer=5Fstack=20check-mode-sicher?= =?UTF-8?q?=20(Fetch/Secrets/Handler=20guarden);=20site.yml=20--check=20--?= =?UTF-8?q?diff=20auf=20production=20gr=C3=BCn=20(changed=3D19)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .../ansible/roles/fluxer_stack/handlers/main.yml | 2 ++ .../ansible/roles/fluxer_stack/tasks/main.yml | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/handlers/main.yml b/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/handlers/main.yml index f71280e..7c33ad1 100644 --- a/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/handlers/main.yml +++ b/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/handlers/main.yml @@ -2,8 +2,10 @@ - name: Reload systemd for the Fluxer stack ansible.builtin.systemd_service: daemon_reload: true + when: not ansible_check_mode - name: Restart the Fluxer stack ansible.builtin.systemd_service: name: "{{ fluxer_stack_service_name }}" state: restarted + when: not ansible_check_mode diff --git a/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/tasks/main.yml b/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/tasks/main.yml index 8408cb2..0259330 100644 --- a/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/tasks/main.yml +++ b/proxmox/lxc/ct-117-fluxer/ansible/roles/fluxer_stack/tasks/main.yml @@ -29,7 +29,7 @@ group: root mode: "0750" -- name: Fetch the pinned upstream compose file +- name: Fetch the pinned upstream compose file (SHA-256-verifiziert) ansible.builtin.get_url: url: "{{ fluxer_stack_compose_url }}" dest: "{{ fluxer_stack_compose_file }}" @@ -40,6 +40,16 @@ timeout: 60 notify: - Restart the Fluxer stack + # in check mode the stack directory is not created yet, so the fetch is + # only previewed; the real run verifies the checksum + when: not ansible_check_mode + +- name: Note the deferred compose fetch in check mode + ansible.builtin.debug: + msg: >- + check mode: compose fetch ({{ fluxer_stack_compose_url }}, + sha256 {{ fluxer_stack_compose_sha256 }}) is verified on the real run + when: ansible_check_mode - name: Read the pinned compose for the service-name assertions ansible.builtin.slurp: @@ -101,18 +111,21 @@ owner: root group: root mode: "0600" + when: not ansible_check_mode # file is created by the generate task above - name: Read the persisted secrets ansible.builtin.slurp: src: "{{ fluxer_stack_secrets_file }}" register: fluxer_stack_secrets_content no_log: true + when: not ansible_check_mode - name: Expose the secret lines to the .env template ansible.builtin.set_fact: fluxer_stack_secret_lines: >- {{ fluxer_stack_secrets_content.content | b64decode | trim }} no_log: true + when: not ansible_check_mode - name: Render the compose .env (root-only) ansible.builtin.template: @@ -124,6 +137,7 @@ notify: - Restart the Fluxer stack no_log: true + when: not ansible_check_mode - name: Check a pinned image locally ansible.builtin.command: