From 6e6613fc5da36a6c173f8438da1730cf8ff99139 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Fri, 29 Apr 2022 10:03:57 +0800 Subject: [PATCH] Hostname module support openEuler and remove python-nose --- ansible.spec | 7 ++++-- hostname-module-support-openEuler.patch | 32 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 hostname-module-support-openEuler.patch diff --git a/ansible.spec b/ansible.spec index 7f4420f..54ce985 100644 --- a/ansible.spec +++ b/ansible.spec @@ -2,7 +2,7 @@ Name: ansible Summary: SSH-based configuration management, deployment, and task execution system Version: 2.9.27 -Release: 1 +Release: 2 License: GPLv3+ Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz @@ -16,6 +16,7 @@ Patch1: ansible-2.9.22-rocky.patch Patch2: ansible-2.9.6-disable-test_build_requirement_from_path_no_version.patch Patch3: fix-python-3.9-compatibility.patch Patch4: ansible-2.9.23-sphinx4.patch +Patch5: hostname-module-support-openEuler.patch Provides: ansible-python3 = %{version}-%{release} Obsoletes: ansible-python3 < %{version}-%{release} @@ -46,7 +47,6 @@ BuildRequires: python3-straight-plugin BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-six -BuildRequires: python3-nose BuildRequires: python3-pytest BuildRequires: python3-pytest-xdist BuildRequires: python3-pytest-mock @@ -215,6 +215,9 @@ make PYTHON=/usr/bin/python3 tests-py3 %{python3_sitelib}/ansible_test %changelog +* Fri Apr 29 2022 wangkai - 2.9.27-2 +- Hostname module support openEuler and remove python-nose + * Tue Apr 26 2022 yangping - 2.9.27-1 - update to 2.9.27 diff --git a/hostname-module-support-openEuler.patch b/hostname-module-support-openEuler.patch new file mode 100644 index 0000000..80c0ef7 --- /dev/null +++ b/hostname-module-support-openEuler.patch @@ -0,0 +1,32 @@ +diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py +index 6a93988f..c3184142 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', 'Rocky'], ++ 'AlmaLinux', 'Rocky', '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 3315cec8..c01d1e62 100644 +--- a/lib/ansible/modules/system/hostname.py ++++ b/lib/ansible/modules/system/hostname.py +@@ -787,6 +787,11 @@ class RockyLinuxHostname(Hostname): + distribution = 'Rocky' + strategy_class = SystemdStrategy + ++class OpenEulerHostname(Hostname): ++ platform = 'Linux' ++ distribution = 'Openeuler' ++ strategy_class = SystemdStrategy ++ + def main(): + module = AnsibleModule( + argument_spec=dict( +-- +2.27.0 + -- Gitee