Extended distributions list for hostname module

Implementations already present
Fix extra newline at end of hostname for Fedora

This fixes a bug introduced by 138b45e3.
The hostname has an additional newline at the end which leads to the
state always being 'changed: true' even if the hostname is unchanged.
Merge pull request #8307 from robinro/fix-extra-newline

Fix extra newline at end of hostname for Fedora
Merge pull request #8308 from robinro/extend-hostname-distrolist

Extended distributions list for hostname module
Expand variables in configuration files

e.g. $HOME. Fixes #6373.