GNAI-025: fluxer_stack check-mode-sicher (Fetch/Secrets/Handler guarden); site.yml --check --diff auf production grün (changed=19)
Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user