ansible/changelogs/fragments/66432_hostname_check_mode_writes.yml
Rick Elrod 2ad10ffe43 hostname: Make strategies consistent, drop py2.4
Change:
- Make strategies behave consistently and return the empty string
  instead of "UNKNOWN" (or "temporarystub") for the "before" value if
  the permanent hostname file does not exist or could not be read.
- Switch to `with open()` instead of annoying exception handling code
  (which was wrong and leaked file handles in several places). This
  drops Python 2.4 support for this module.
- Updated porting guide since users could be relying on these former,
  inconsistent values.

Signed-off-by: Rick Elrod <rick@elrod.me>
2021-05-27 13:15:52 +02:00

7 lines
870 B
YAML

bugfixes:
- hostname - No longer modifies system files in get_* methods and therefore when consulted in check_mode (https://github.com/ansible/ansible/issues/66432)
breaking_changes:
- hostname - Drops any remaining support for Python 2.4 by using ``with open()`` to simplify exception handling code which leaked file handles in several spots
- hostname - On FreeBSD, the string ``temporarystub`` no longer gets written to the hostname file in the get methods (and in check_mode). As a result, the default hostname will now appear as ``''`` (empty string) instead of ``temporarystub`` for consistency with other strategies. This means the ``before`` result will be different.
- hostname - On OpenRC systems and Solaris, the ``before`` value will now be ``''`` (empty string) if the permanent hostname file does not exist, for consistency with other strategies.