From d9da7755d7d4624722c9f0a660003b2538a8388d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de> Date: Mon, 5 Jun 2023 16:39:55 +0200 Subject: [PATCH] style: satisfy linter --- .ansible-lint | 1 + handlers/main.yml | 1 + molecule/virtualbox_centos7/molecule.yml | 2 +- tasks/configure_kdump.yml | 5 ++++- tasks/rosetta/install_error_summary.yml | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 5620f63..491cf72 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -38,6 +38,7 @@ skip_list: - skip_this_tag - git-latest - name[casing] + - package-latest # Any rule that has the 'opt-in' tag will not be loaded unless its 'id' is # mentioned in the enable_list: diff --git a/handlers/main.yml b/handlers/main.yml index 1b1581b..2ce5397 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -38,6 +38,7 @@ - name: activate kernel parameter changes ansible.builtin.command: sysctl -p + changed_when: false - name: daemon-reload ansible.builtin.systemd: diff --git a/molecule/virtualbox_centos7/molecule.yml b/molecule/virtualbox_centos7/molecule.yml index d1b7f16..2e859f6 100644 --- a/molecule/virtualbox_centos7/molecule.yml +++ b/molecule/virtualbox_centos7/molecule.yml @@ -34,7 +34,7 @@ platforms: # Dictionary of `config` options. config_options: ssh.keep_alive: true - ssh.remote_user: "'lza'" + ssh.remote_user: "lza" disksize.size: '20GB' provisioner: name: ansible diff --git a/tasks/configure_kdump.yml b/tasks/configure_kdump.yml index 0444834..472e3f2 100644 --- a/tasks/configure_kdump.yml +++ b/tasks/configure_kdump.yml @@ -7,7 +7,10 @@ # of the crash. Kernel core dumps may consume a considerable amount of disk # space and may result in denial of service by exhausting the available space # on the target file system partition." -- name: find out if kdump.service exists + +# This task uses the command module, because the systemd module would fail if +# the Service didn't exist. +- name: find out if kdump.service exists # noqa command-instead-of-module ansible.builtin.command: "systemctl list-unit-files kdump.service" register: kdump changed_when: false diff --git a/tasks/rosetta/install_error_summary.yml b/tasks/rosetta/install_error_summary.yml index bb8d5f6..f58ec56 100644 --- a/tasks/rosetta/install_error_summary.yml +++ b/tasks/rosetta/install_error_summary.yml @@ -37,7 +37,7 @@ pattern: "error-summary.*" register: error_summary_units -- name: check if error summary units are already enabled +- name: check if error summary units are already enabled # noqa command-instead-of-module ansible.builtin.command: "systemctl is-enabled {{ item.path | basename }}" loop: "{{ error_summary_units.files }}" register: error_summary_enabled @@ -48,7 +48,7 @@ - '"No such file or directory" not in error_summary_enabled.stderr' - name: manually enable error_summary.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 }}" + ansible.builtin.command: "systemctl enable {{ item.item.path }}" # noqa command-instead-of-module loop: "{{ error_summary_enabled.results }}" when: - item.stdout != "enabled" -- GitLab