Skip to content

Commit

Permalink
hostname - Correct distribution for various Linux distros based on ou…
Browse files Browse the repository at this point in the history
…tput from distro library (ansible#56936)

* Adjust hostname classes based on output from distro

Corrects the following:
- OpenSUSE Leap
- ArchARM
- Oracle Linux

* Add CoreOS and Clear Linux distributions
  • Loading branch information
samdoran authored Jun 21, 2019
1 parent d010510 commit bd55617
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/hostname-update-distros.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- hostname - make module work on CoreOS, Oracle Linux, Clear Linux, OpenSUSE Leap, ArchARM (https://github.com/ansible/ansible/issues/42726)
26 changes: 25 additions & 1 deletion lib/ansible/modules/system/hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,12 +583,24 @@ class OpenSUSEHostname(Hostname):
strategy_class = SystemdStrategy


class OpenSUSELeapHostname(Hostname):
platform = 'Linux'
distribution = 'Opensuse-leap'
strategy_class = SystemdStrategy


class ArchHostname(Hostname):
platform = 'Linux'
distribution = 'Arch'
strategy_class = SystemdStrategy


class ArchARMHostname(Hostname):
platform = 'Linux'
distribution = 'Archarm'
strategy_class = SystemdStrategy


class RHELHostname(Hostname):
platform = 'Linux'
distribution = 'Redhat'
Expand All @@ -601,12 +613,24 @@ class CentOSHostname(Hostname):
strategy_class = RedHatStrategy


class ClearLinuxHostname(Hostname):
platform = 'Linux'
distribution = 'Clear-linux-os'
strategy_class = SystemdStrategy


class CloudlinuxHostname(Hostname):
platform = 'Linux'
distribution = 'Cloudlinux'
strategy_class = RedHatStrategy


class CoreosHostname(Hostname):
platform = 'Linux'
distribution = 'Coreos'
strategy_class = SystemdStrategy


class ScientificHostname(Hostname):
platform = 'Linux'
distribution = 'Scientific'
Expand All @@ -615,7 +639,7 @@ class ScientificHostname(Hostname):

class OracleLinuxHostname(Hostname):
platform = 'Linux'
distribution = 'Oracle'
distribution = 'Ol'
strategy_class = RedHatStrategy


Expand Down

0 comments on commit bd55617

Please sign in to comment.