Warning feature idea; interest level and feedback requested

Hi everyone,

If this feature has been proposed int he past, I apologize in advance.

I’d like to see a generic “warning” feature in ansible, that could possibly have several components:

  • The feature would add a warning count to the end-of-run ok/changed/unreachable/failed summary.
  • There would be capability for a more verbose printing of the details of each warning AT THE END of the run.
  • The warning count (and details message) could be triggered in different ways, for example
  • An independent warning module similar to debug
  • A warning flag that can be enabled on individual modules. An example would be for any of the packaging modules, if state is set to present, but newer versions of the package exist, report a warning (my #1 use case right now).
    I’m happy to contribute time towards developing this feature–with community input and feedback–if interest exists.

Best,
Kale

I think it’s unlikely that we would want to have a check for updated versions of modules with present in that particular case but it would be fine if you wrote something to do an explicit check.

This is kind of like the idea of being able to run just one task in check mode, and may be a cleaner solution for that third example.

I’m somewhat ok with the idea of a module returning “warn: True” having some semantics. Need to think through it though, can you share what a playbook might look like (exempting case #3?)