From ae7a72600932ba4a1c1a3c85115f9b609afb7bd5 Mon Sep 17 00:00:00 2001
Date: Mon, 28 Feb 2022 20:02:47 +0800
Subject: [PATCH 1/1] hostname module support openEuler

---
 lib/ansible/module_utils/facts/system/distribution.py | 2 +-
 lib/ansible/modules/system/hostname.py                | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py
index 09b5a5fd..9046a34a 100644
--- a/lib/ansible/module_utils/facts/system/distribution.py
+++ b/lib/ansible/module_utils/facts/system/distribution.py
@@ -467,7 +467,7 @@ class Distribution(object):
     OS_FAMILY_MAP = {'RedHat': ['RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC',
                                 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS',
                                 'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba',
-                                'AlmaLinux'],
+                                'AlmaLinux', 'openEuler'],
                      'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon',
                                 'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux'],
                      'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed',
diff --git a/lib/ansible/modules/system/hostname.py b/lib/ansible/modules/system/hostname.py
index bfc24b35..f10739c5 100644
--- a/lib/ansible/modules/system/hostname.py
+++ b/lib/ansible/modules/system/hostname.py
@@ -782,6 +782,10 @@ class NeonHostname(Hostname):
     distribution = 'Neon'
     strategy_class = DebianStrategy
 
+class OpenEulerHostname(Hostname):
+    platform = 'Linux'
+    distribution = 'Openeuler'
+    strategy_class = SystemdStrategy
 
 def main():
     module = AnsibleModule(
-- 
2.27.0

