diff --git a/ansible.spec b/ansible.spec index 85eb0161c79643e066b80cb63f560115c8c229d2..73d21f536c2a81ba285a646fab44c3dd8e3ab381 100644 --- a/ansible.spec +++ b/ansible.spec @@ -11,10 +11,11 @@ Name: ansible Summary: SSH-based configuration management, deployment, and task execution system Version: 2.9.27 -Release: 0 +Release: 1 License: Python-2.0 and MIT and GPL+ Url: http://ansible.com Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz +Patch0: hostname-module-support-openEuler.patch BuildArch: noarch Provides: ansible-fireball = %{version}-%{release} Obsoletes: ansible-fireball < 1.2.4 @@ -55,6 +56,7 @@ Obsoletes: %{name}-doc < %{name}-%{release} %prep %setup -q +%patch0 -p1 %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -114,6 +116,9 @@ cp -pr docs/docsite/rst . %endif %changelog +* Tue Mar 01 2022 wangkai - 2.9.27-1 +- Hostname module support openEuler + * Wed Jan 12 2022 wulei - 2.9.27-0 - Package update diff --git a/hostname-module-support-openEuler.patch b/hostname-module-support-openEuler.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c17f95a667c10062d6d1e4d90372428c9afa593 --- /dev/null +++ b/hostname-module-support-openEuler.patch @@ -0,0 +1,40 @@ +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 +