Closed afeefghannam89 closed 1 year ago
Ok, if you find some, please try changing them. The less we have of these things, the better!
I've taken the time and created a branch deleting a few of the changed_when: false
statements that seemed unnecessary to me.
In these cases checks are already performed to determine whether the task should even run. If it should, we have already determined that we expect a change, thus we can leave it out.
But from this arises a new problem: ansible-lint.
ansible-lint now complains about missing changed_when
statements on the command
and shell
modules. We know it's (probably) correct but the linter does not.
I think we have two options here:
changed_when
an errorchanged_when: false
for changed_when: true
I'm not sure if the first option is desirable.
The second option does not get rid of the statements themselves. It, however, would better reflect actual changes made to the systems, which I believe to be a good thing.
We could get rid of a few of those changed_when: false
statements, but we'd need to change the linter rules.
I think, in some tasks checnged_when false does not serve any goal, we should check them again