79118907

Date: 2024-10-23 16:49:34
Score: 1
Natty:
Report link

In general, this isn't possible.

If a task is "changed", whether in check_mode or not, it will be displayed as such, both in the play logs and in the PLAY RECAP, unless changed_when: false is set. For some modules, it is possible to set changed_when: false, register the result, and use a module-specific return value in later conditionals (like rc for ansible.builtin.command).

For the zypper-specific problem mentioned in the question, it's possible to use package_facts instead, as pointed out in @Zeitounator's comment.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Zeitounator's
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: uncleremus