From 56da7170d407911f40c1d02a75226e4132c08569 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 3 Apr 2023 11:25:46 +0100 Subject: [PATCH] Document that no-changed-when also applies to handlers (#3237) --- src/ansiblelint/rules/no_changed_when.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ansiblelint/rules/no_changed_when.md b/src/ansiblelint/rules/no_changed_when.md index 2e0cb82263..95c1d46f1e 100644 --- a/src/ansiblelint/rules/no_changed_when.md +++ b/src/ansiblelint/rules/no_changed_when.md @@ -12,9 +12,12 @@ detect if a change has occurred or not. Some of the most common examples are [shell] and [command] modules, which run arbitrary commands. One very common workaround is to use a boolean value like `changed_when: false` -if the task never changes anything or `changed_when: true` if it always -changes something, but you can also use any expressions, including ones that -use the registered result of a task, like in our example below. +if the task never changes anything or `changed_when: true` if it always changes +something, but you can also use any expressions, including ones that use the +registered result of a task, like in our example below. + +This rule also applies to handlers, not only to tasks because they are also +tasks. ## Problematic Code