"hostname" Module Does Not Work on RHEL 7

I've got some RHEL 7 machines already that need to be managed by
Ansible. So far, the only problem I've found is that the "hostname"
module fails to permanently set the hostname of the machine. This is
because the HOSTNAME variable in /etc/sysconfig/network no longer has
any effect, as RHEL 7 uses systemd. Looking through the code of the
"hostname" module, I don't see any good way to fix this. It is using
the "load_platform_subclass" utility function, which only works on the
distribution name and ignores the version number.

Are there any current plans for being able to support different
versions of distributions independently? What are your thoughts on how
this should be done within Ansible? Right now, only "hostname" seems
affected, but there could be others, now or in the future, so fixing
it there doesn't seem to be the best option.

Regards,

Dustin C. Hatch
http://dustin.hatch.name/

You can look at what we do for returning OS version facts in the “setup” module…

Fixing it in the module that has the problem is 100% the right option.