From e6d81a526d47cb83a4c2b629a604754caca0f1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de> Date: Mon, 9 Jan 2023 14:47:57 +0100 Subject: [PATCH] chore: remove unnecessary task and satisfy linter --- tasks/install_move_logs.yml | 51 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/tasks/install_move_logs.yml b/tasks/install_move_logs.yml index f74c508..fca50d5 100644 --- a/tasks/install_move_logs.yml +++ b/tasks/install_move_logs.yml @@ -1,13 +1,4 @@ --- -- name: disable legacy SystemD units - ansible.builtin.systemd: - unit: "{{ item }}" - state: stopped - enabled: false - loop: - - "move_old_logs.service" - - "move_old_logs.timer" - ignore_errors: true - name: remove legacy timer/service/script ansible.builtin.file: path: "{{ item }}" @@ -64,26 +55,26 @@ enabled: true state: started -#- name: find move_old_logs systemd units so we don't have to hardcode their names in the loops -# ansible.builtin.find: -# path: "/usr/local/lib/systemd/system/" -# pattern: "move_old_logs.*" -# register: move_old_logs_units +# - name: find move_old_logs systemd units so we don't have to hardcode their names in the loops +# ansible.builtin.find: +# path: "/usr/local/lib/systemd/system/" +# pattern: "move_old_logs.*" +# register: move_old_logs_units # -#- name: check if move_old_logs units are already enabled -# ansible.builtin.command: "systemctl is-enabled {{ item.path | basename }}" -# loop: "{{ move_old_logs_units.files }}" -# register: move_old_logs_enabled -# changed_when: false -# failed_when: -# - move_old_logs_enabled.stdout != "enabled" -# - move_old_logs_enabled.stdout != "disabled" -# - '"No such file or directory" not in move_old_logs_enabled.stderr' +# - name: check if move_old_logs units are already enabled +# ansible.builtin.command: "systemctl is-enabled {{ item.path | basename }}" +# loop: "{{ move_old_logs_units.files }}" +# register: move_old_logs_enabled +# changed_when: false +# failed_when: +# - move_old_logs_enabled.stdout != "enabled" +# - move_old_logs_enabled.stdout != "disabled" +# - '"No such file or directory" not in move_old_logs_enabled.stderr' # -#- name: manually enable move_old_logs.service, because it cannot be found by the ansible.builtin.systemd module when the timer is located below "/etc/systemd/user/" -# ansible.builtin.command: "systemctl enable {{ item.item.path }}" -# loop: "{{ move_old_logs_enabled.results }}" -# when: -# - item.stdout != "enabled" -# register: move_old_logs_enablecmd -# changed_when: move_old_logs_enablecmd.stdout in "Created symlink" +# - name: manually enable move_old_logs.service, because it cannot be found by the ansible.builtin.systemd module when the timer is located below "/etc/systemd/user/" +# ansible.builtin.command: "systemctl enable {{ item.item.path }}" +# loop: "{{ move_old_logs_enabled.results }}" +# when: +# - item.stdout != "enabled" +# register: move_old_logs_enablecmd +# changed_when: move_old_logs_enablecmd.stdout in "Created symlink" -- GitLab