From 4f29dbb2b82f0c29bdb385741ac1852550c1e210 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sat, 6 Jul 2019 14:43:04 +0200 Subject: roles: fix warnings about bare boolean variables --- roles/debian/tasks/hostname.yml | 2 +- roles/debian/tasks/main.yml | 2 +- roles/debian/tasks/networkd.yml | 6 +++--- roles/debian/tasks/resolved.yml | 8 ++++---- roles/debian/tasks/sshd.yml | 2 +- roles/debian/tasks/timesyncd.yml | 2 +- roles/debian/tasks/timezone.yml | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'roles/debian') diff --git a/roles/debian/tasks/hostname.yml b/roles/debian/tasks/hostname.yml index 6709c03..214f243 100644 --- a/roles/debian/tasks/hostname.yml +++ b/roles/debian/tasks/hostname.yml @@ -10,6 +10,6 @@ owner: root group: root mode: 0644 - when: chroot + when: chroot|bool # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index 71637c1..407040e 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -3,7 +3,7 @@ tags: apt - import_tasks: tmpfs.yml tags: tmpfs - when: use_tmpfs + when: use_tmpfs|bool - import_tasks: hosts.yml tags: hosts - import_tasks: timezone.yml diff --git a/roles/debian/tasks/networkd.yml b/roles/debian/tasks/networkd.yml index 967dace..3ad37df 100644 --- a/roles/debian/tasks/networkd.yml +++ b/roles/debian/tasks/networkd.yml @@ -10,7 +10,7 @@ when: not chroot - name: '- when in chroot' command: "systemctl {{ use_networkd|ternary('enable','disable') }} systemd-networkd.service" - when: chroot + when: chroot|bool # in Debian 9 (stretch) we need to enable this manually # this is fixed in buster though @@ -22,7 +22,7 @@ when: ansible_distribution_release == 'stretch' and not chroot - name: '- when in chroot' command: "systemctl {{ use_networkd|ternary('enable','disable') }} systemd-networkd-wait-online.service" - when: ansible_distribution_release == 'stretch' and chroot + when: ansible_distribution_release == 'stretch' and chroot|bool # use RequiredForOnline in systemd.network files if possible, # but for older systemd's set networkd_ignore: ['eth0', 'eth1'] @@ -53,6 +53,6 @@ block: - command: systemctl disable networking.service - command: systemctl mask networking.service - when: use_networkd and chroot + when: use_networkd|bool and chroot|bool # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/resolved.yml b/roles/debian/tasks/resolved.yml index 0190c77..9a6d4c1 100644 --- a/roles/debian/tasks/resolved.yml +++ b/roles/debian/tasks/resolved.yml @@ -8,7 +8,7 @@ value: "{{ item.value|ternary(item.value,omit) }}" state: "{{ item.value|ternary('present','absent') }}" with_dict: '{{ resolved_conf }}' - when: use_resolved + when: use_resolved|bool notify: restart resolved - name: Enable/disable systemd-resolved @@ -20,7 +20,7 @@ when: not chroot - name: '- when in chroot' command: "systemctl {{ use_resolved|ternary('enable','disable') }} systemd-resolved.service" - when: chroot + when: chroot|bool - name: Symlink /etc/resolv.conf file: @@ -28,12 +28,12 @@ src: '/run/systemd/resolve/resolv.conf' state: link force: yes - when: use_resolved + when: use_resolved|bool - name: Use myhostname and possibly resolved nss plugins lineinfile: path: /etc/nsswitch.conf regexp: '^hosts:' line: 'hosts: files resolve [!UNAVAIL=return] dns myhostname' - when: use_resolved + when: use_resolved|bool # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/sshd.yml b/roles/debian/tasks/sshd.yml index a0a2d96..62aa1cc 100644 --- a/roles/debian/tasks/sshd.yml +++ b/roles/debian/tasks/sshd.yml @@ -51,6 +51,6 @@ when: not chroot - name: '- when in chroot' command: systemctl enable ssh.service - when: chroot + when: chroot|bool # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/timesyncd.yml b/roles/debian/tasks/timesyncd.yml index 63949fc..180d8c2 100644 --- a/roles/debian/tasks/timesyncd.yml +++ b/roles/debian/tasks/timesyncd.yml @@ -20,6 +20,6 @@ when: not chroot - name: '- when in chroot' command: systemctl enable systemd-timesyncd.service - when: chroot + when: chroot|bool # vim: set ts=2 sw=2 et: diff --git a/roles/debian/tasks/timezone.yml b/roles/debian/tasks/timezone.yml index a917dd4..efe6546 100644 --- a/roles/debian/tasks/timezone.yml +++ b/roles/debian/tasks/timezone.yml @@ -9,6 +9,6 @@ src: '../usr/share/zoneinfo/{{ timezone }}' state: link force: yes - when: chroot + when: chroot|bool # vim: set ts=2 sw=2 et: -- cgit v1.2.1