From 6abfd1e88722326480192f49833ddceaf29f5498 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Thu, 27 Feb 2020 18:47:30 +0100 Subject: debian: allow empty strings in ini files --- roles/debian/tasks/networkd.yml | 4 ++-- roles/debian/tasks/resolved.yml | 4 ++-- roles/debian/tasks/systemd.yml | 12 ++++++------ roles/debian/tasks/timesyncd.yml | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'roles') diff --git a/roles/debian/tasks/networkd.yml b/roles/debian/tasks/networkd.yml index 074992a..49b3041 100644 --- a/roles/debian/tasks/networkd.yml +++ b/roles/debian/tasks/networkd.yml @@ -7,8 +7,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ networkd_conf }}' when: use_networkd|bool diff --git a/roles/debian/tasks/resolved.yml b/roles/debian/tasks/resolved.yml index 4fcc34b..9b8d589 100644 --- a/roles/debian/tasks/resolved.yml +++ b/roles/debian/tasks/resolved.yml @@ -7,8 +7,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ resolved_conf }}' when: use_resolved|bool notify: restart resolved diff --git a/roles/debian/tasks/systemd.yml b/roles/debian/tasks/systemd.yml index a2b9e4b..5413266 100644 --- a/roles/debian/tasks/systemd.yml +++ b/roles/debian/tasks/systemd.yml @@ -7,8 +7,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ systemd_conf }}' - name: Configure journald.conf @@ -19,8 +19,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ journald_conf }}' - name: Configure logind.conf @@ -31,8 +31,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ logind_conf }}' # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/timesyncd.yml b/roles/debian/tasks/timesyncd.yml index 9895d0b..17693c3 100644 --- a/roles/debian/tasks/timesyncd.yml +++ b/roles/debian/tasks/timesyncd.yml @@ -7,8 +7,8 @@ no_extra_spaces: yes section: "{{ item.key.split('.',1)[0] }}" option: "{{ item.key.split('.',1)[1] }}" - value: "{{ item.value|ternary(item.value,omit) }}" - state: "{{ item.value|ternary('present','absent') }}" + value: "{{ (item.value is string)|ternary(item.value,omit) }}" + state: "{{ (item.value is string)|ternary('present','absent') }}" with_dict: '{{ timesyncd_conf }}' when: use_timesyncd notify: restart timesyncd -- cgit v1.2.1