Optimized variable conditions for ansible update 2.18 -> 2.20

This commit is contained in:
2025-12-04 12:24:01 +01:00
parent 73ec220847
commit d0efc77b6c
5 changed files with 6 additions and 6 deletions

View File

@@ -14,11 +14,11 @@
- name: "Note: both Cloud token and Robot creds provided; using Cloud flavor"
debug:
msg: "Both HETZNER_API_TOKEN and Robot credentials present → proceeding with Cloud (hcloud) flavor."
when: _use_cloud and _use_robot
when: _use_cloud | bool and _use_robot | bool
- name: Include Cloud flavor (hcloud)
include_tasks: flavors/cloud.yml
when: _use_cloud
when: _use_cloud | bool
- name: Include Robot flavor (Robot Webservice)
include_tasks: flavors/robot.yml

View File

@@ -14,7 +14,7 @@
app_style_present: "{{ _app_style_src | length > 0 }}"
- name: "Deploy per-app '{{ app_style_src }}' to '{{ css_app_dst }}'"
when: app_style_present
when: app_style_present | bool
copy:
content: "{{ lookup('template', app_style_src) }}"
dest: "{{ css_app_dst }}"

View File

@@ -56,7 +56,7 @@
- name: Execute Cleanup Routines
include_tasks: 03_cleanup.yml
when: MODE_CLEANUP
when: MODE_CLEANUP | bool
- name: Include DNS role to register Gitea domain(s)
include_role:

View File

@@ -36,4 +36,4 @@
vars:
plugin_key: "{{ plugin_item.key }}"
plugin_value: "{{ plugin_item.value }}"
when: NEXTCLOUD_PLUGINS_ENABLED
when: NEXTCLOUD_PLUGINS_ENABLED | bool

View File

@@ -56,7 +56,7 @@
plugin_name: "{{ item.key }}"
plugin_enabled: "{{ item.value.enabled | bool }}"
plugin_task_path: "{{ [role_path, 'tasks/plugins', plugin_name ~ '.yml' ] | path_join }}"
when: plugin_enabled
when: plugin_enabled | bool
- name: Detect if WordPress is Multisite
command: >