commit b1acb948c36a5263b5a07baf6ef91c6c2c2caae9
parent df524c55ecc8d4cbae333069b86b97b8eb15e6c7
Author: Florian Dold <dold@taler.net>
Date: Fri, 4 Sep 2026 19:25:56 +0200
exchange: report Typst install in check mode
Run the read-only version probes during check mode, but skip the
temporary directory, download, extraction, and copy operations. Report
the predicted installation as changed without resolving an absent
tempfile path.
Diffstat:
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/roles/exchange/tasks/main.yml b/roles/exchange/tasks/main.yml
@@ -46,13 +46,29 @@
register: typst_version_check
changed_when: false
failed_when: false
+ check_mode: false
when: typst_stat.stat.exists
-- name: Install or Update Typst
- # Only runs if binary is missing OR the version string doesn't match our target
- when: >
- not typst_stat.stat.exists or
- typst_version not in (typst_version_check.stdout | default(''))
+- name: Determine whether Typst must be installed
+ ansible.builtin.set_fact:
+ exchange_typst_install_required: >-
+ {{
+ not typst_stat.stat.exists or
+ typst_version not in (typst_version_check.stdout | default(''))
+ }}
+
+- name: Report pending Typst installation in check mode
+ ansible.builtin.debug:
+ msg: Typst {{ typst_version }} would be installed.
+ changed_when: true
+ when:
+ - ansible_check_mode
+ - exchange_typst_install_required
+
+- name: Install or update Typst
+ when:
+ - exchange_typst_install_required
+ - not ansible_check_mode
block:
- name: Create temporary directory for extraction
ansible.builtin.tempfile:
@@ -93,6 +109,8 @@
register: typst_final_check
changed_when: false
failed_when: "typst_version not in typst_final_check.stdout"
+ check_mode: false
+ when: not (ansible_check_mode and exchange_typst_install_required)
- name: Ensure Taler exchange virtualhost configuration file exists
ansible.builtin.template: