Hi,
I've been asked to determine what is the current state of some setting
and what it's going to be changed to. The reasoning is that, this being
a legacy environment full of manual controls, people want to see with
their own eyes what Ansible is going to do before giving the OK. These
enterprise folks know how to be boring, I know.
As a test, I changed the sysctl.py module to call exit_json with some
additional parameters (namely, value_from and value_to). So the output
in verbose mode was something like this:
TASK: [sap_common | sysctl net.ipv4.ip_local_port_range]
Yes, that works fine for template/copy, but it seems very specific for
file changes.
It seems returning something in a simple matter of passing it to
exit_json/fail_json. However, I wonder if a convention should be
followed to avoid one module calling it value_from, orig_value,
prev_value, prev_data, etc.
At the same time I'm thinking how likely it's that other people would
find this valuable. I myself have not had the need until management
asked for it and can't feel much sympathy for what we'll be done with
this output in this case. But if more people find it usable I could work
on something, although it looks like a long-term process of improving
module by module.
Giovanni