From fb98d53fad342add0c2a5527e13b1e9ac5fdd365 Mon Sep 17 00:00:00 2001 From: Daniel Werz Date: Tue, 3 Mar 2026 16:15:03 +0100 Subject: [PATCH] Fix conditional check of string variable --- roles/lmn_misc/tasks/main.yml | 2 +- roles/lmn_network/tasks/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/lmn_misc/tasks/main.yml b/roles/lmn_misc/tasks/main.yml index 27fb25c..212e418 100644 --- a/roles/lmn_misc/tasks/main.yml +++ b/roles/lmn_misc/tasks/main.yml @@ -98,7 +98,7 @@ export superusers password_pbkdf2 root {{ grub_pwd }} notify: Run update-grub - when: grub_pwd | bool | default(false) + when: grub_pwd is defined and grub_pwd is truthy - name: Allow booting grub menu entries ansible.builtin.lineinfile: diff --git a/roles/lmn_network/tasks/main.yml b/roles/lmn_network/tasks/main.yml index 571c107..416a173 100644 --- a/roles/lmn_network/tasks/main.yml +++ b/roles/lmn_network/tasks/main.yml @@ -5,14 +5,14 @@ mode: '0644' content: > {{ apt_conf }} - when: apt_conf | bool | default(false) + when: apt_conf is defined and apt_conf is truthy - name: Set NTP server ansible.builtin.lineinfile: path: /etc/systemd/timesyncd.conf insertafter: '^#NTP=' line: NTP={{ ntp_serv }} - when: ntp_serv | bool | default(false) + when: ntp_serv is defined and ntp_serv is truthy - name: Add proposed-updates repository ansible.builtin.apt_repository: