From 7a780060792832407914ab596428c290e8937060 Mon Sep 17 00:00:00 2001 From: tanwigeetika1618 <84617407+tanwigeetika1618@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:19:14 +0530 Subject: [PATCH] fix: Add reset-failed state in executable_options (#4301) --- examples/playbooks/rule-command-instead-of-module-pass.yml | 4 ++++ src/ansiblelint/rules/command_instead_of_module.py | 1 + 2 files changed, 5 insertions(+) diff --git a/examples/playbooks/rule-command-instead-of-module-pass.yml b/examples/playbooks/rule-command-instead-of-module-pass.yml index 2fbc5c2ad3..fec33c20c9 100644 --- a/examples/playbooks/rule-command-instead-of-module-pass.yml +++ b/examples/playbooks/rule-command-instead-of-module-pass.yml @@ -34,6 +34,10 @@ ansible.builtin.command: systemctl kill --signal=SIGUSR1 sshd changed_when: false + - name: Reset a service with systemctl reset-failed + ansible.builtin.command: systemctl reset-failed sshd + changed_when: false + - name: Clear yum cache ansible.builtin.command: yum clean all changed_when: false diff --git a/src/ansiblelint/rules/command_instead_of_module.py b/src/ansiblelint/rules/command_instead_of_module.py index ea03a5fbec..3765c6fc10 100644 --- a/src/ansiblelint/rules/command_instead_of_module.py +++ b/src/ansiblelint/rules/command_instead_of_module.py @@ -78,6 +78,7 @@ class CommandsInsteadOfModulesRule(AnsibleLintRule): "set-property", "show-environment", "status", + "reset-failed", ], "yum": ["clean", "history", "info"], "rpm": ["--nodeps"],