2020-07-31 15:06:51 +08:00
|
|
|
From 098429a75ea00df1d8a5670e45df6babfc37f327 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: chengquan <chengquan3@huawei.com>
|
|
|
|
|
Date: Thu, 8 Aug 2019 16:11:58 +0800
|
2022-11-30 15:43:20 +08:00
|
|
|
Subject: [PATCH] cloud-init: cloud-init add oe os
|
2020-07-31 15:06:51 +08:00
|
|
|
|
2022-11-30 15:43:20 +08:00
|
|
|
reason: add oe into distros
|
2020-07-31 15:06:51 +08:00
|
|
|
|
|
|
|
|
Signed-off-by: chengquan <chengquan3@huawei.com>
|
|
|
|
|
---
|
2022-03-31 14:22:42 +08:00
|
|
|
cloudinit/config/cc_ntp.py | 2 +-
|
2023-07-12 15:58:59 +08:00
|
|
|
cloudinit/config/cc_resolv_conf.py | 1 +
|
2022-03-31 14:22:42 +08:00
|
|
|
cloudinit/config/cc_rh_subscription.py | 2 +-
|
|
|
|
|
cloudinit/config/cc_spacewalk.py | 2 +-
|
|
|
|
|
cloudinit/config/cc_yum_add_repo.py | 2 +-
|
|
|
|
|
cloudinit/distros/__init__.py | 2 +-
|
|
|
|
|
cloudinit/distros/openeuler.py | 12 ++++++++++++
|
|
|
|
|
config/cloud.cfg.tmpl | 8 ++++----
|
|
|
|
|
systemd/cloud-init-generator.tmpl | 2 +-
|
|
|
|
|
systemd/cloud-init.service.tmpl | 2 +-
|
2022-07-28 16:58:38 +08:00
|
|
|
tests/unittests/test_cli.py | 2 +-
|
2022-03-31 14:22:42 +08:00
|
|
|
tools/render-cloudcfg | 2 +-
|
2023-07-12 15:58:59 +08:00
|
|
|
12 files changed, 26 insertions(+), 13 deletions(-)
|
2022-03-31 14:22:42 +08:00
|
|
|
create mode 100644 cloudinit/distros/openeuler.py
|
2020-07-31 15:06:51 +08:00
|
|
|
|
|
|
|
|
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index 8d83433..508f1ed 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/config/cc_ntp.py
|
|
|
|
|
+++ b/cloudinit/config/cc_ntp.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -35,7 +35,7 @@ distros = [
|
|
|
|
|
"mariner",
|
2022-03-31 14:22:42 +08:00
|
|
|
"miraclelinux",
|
2023-07-12 15:58:59 +08:00
|
|
|
"openbsd",
|
2022-03-31 14:22:42 +08:00
|
|
|
- "openEuler",
|
|
|
|
|
+ "openeuler",
|
2023-07-12 15:58:59 +08:00
|
|
|
"OpenCloudOS",
|
|
|
|
|
"openmandriva",
|
2022-03-31 14:22:42 +08:00
|
|
|
"opensuse",
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index d8a7bfa..b642640 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/config/cc_resolv_conf.py
|
|
|
|
|
+++ b/cloudinit/config/cc_resolv_conf.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -69,6 +69,7 @@ meta: MetaSchema = {
|
|
|
|
|
"sle_hpc",
|
|
|
|
|
"sle-micro",
|
|
|
|
|
"sles",
|
|
|
|
|
+ "openeuler",
|
|
|
|
|
],
|
2022-07-28 16:58:38 +08:00
|
|
|
"frequency": PER_INSTANCE,
|
|
|
|
|
"examples": [
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index 533862a..d92f760 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/config/cc_rh_subscription.py
|
|
|
|
|
+++ b/cloudinit/config/cc_rh_subscription.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -32,7 +32,7 @@ meta: MetaSchema = {
|
2022-07-28 16:58:38 +08:00
|
|
|
"name": "Red Hat Subscription",
|
|
|
|
|
"title": "Register Red Hat Enterprise Linux based system",
|
|
|
|
|
"description": MODULE_DESCRIPTION,
|
|
|
|
|
- "distros": ["fedora", "rhel"],
|
|
|
|
|
+ "distros": ["fedora", "rhel", "openeuler"],
|
|
|
|
|
"frequency": PER_INSTANCE,
|
|
|
|
|
"examples": [
|
|
|
|
|
dedent(
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/cloudinit/config/cc_spacewalk.py b/cloudinit/config/cc_spacewalk.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index c8249e6..bd7a972 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/config/cc_spacewalk.py
|
|
|
|
|
+++ b/cloudinit/config/cc_spacewalk.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -25,7 +25,7 @@ meta: MetaSchema = {
|
2022-07-28 16:58:38 +08:00
|
|
|
"name": "Spacewalk",
|
|
|
|
|
"title": "Install and configure spacewalk",
|
|
|
|
|
"description": MODULE_DESCRIPTION,
|
|
|
|
|
- "distros": ["rhel", "fedora"],
|
|
|
|
|
+ "distros": ["rhel", "fedora", "openeuler"],
|
|
|
|
|
"frequency": PER_INSTANCE,
|
|
|
|
|
"examples": [
|
|
|
|
|
dedent(
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index 097493b..e565a1d 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/config/cc_yum_add_repo.py
|
|
|
|
|
+++ b/cloudinit/config/cc_yum_add_repo.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -32,7 +32,7 @@ distros = [
|
2022-03-31 14:22:42 +08:00
|
|
|
"eurolinux",
|
|
|
|
|
"fedora",
|
2023-07-12 15:58:59 +08:00
|
|
|
"mariner",
|
2022-03-31 14:22:42 +08:00
|
|
|
- "openEuler",
|
|
|
|
|
+ "openeuler",
|
2023-07-12 15:58:59 +08:00
|
|
|
"OpenCloudOS",
|
|
|
|
|
"openmandriva",
|
2022-03-31 14:22:42 +08:00
|
|
|
"photon",
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index ec14893..59bafe0 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/cloudinit/distros/__init__.py
|
|
|
|
|
+++ b/cloudinit/distros/__init__.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -72,7 +72,7 @@ OSFAMILIES = {
|
|
|
|
|
"sle-micro",
|
|
|
|
|
"sles",
|
|
|
|
|
],
|
|
|
|
|
- "openEuler": ["openEuler"],
|
|
|
|
|
+ "openeuler": ["openeuler"],
|
|
|
|
|
"OpenCloudOS": ["OpenCloudOS", "TencentOS"],
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-31 14:22:42 +08:00
|
|
|
diff --git a/cloudinit/distros/openeuler.py b/cloudinit/distros/openeuler.py
|
2020-11-04 10:20:14 +08:00
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..7505ca4
|
|
|
|
|
--- /dev/null
|
2022-03-31 14:22:42 +08:00
|
|
|
+++ b/cloudinit/distros/openeuler.py
|
2020-11-04 10:20:14 +08:00
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
|
+# Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
|
|
|
|
|
+# This file is part of cloud-init. See LICENSE file for license information.
|
|
|
|
|
+
|
|
|
|
|
+from cloudinit.distros import rhel
|
|
|
|
|
+from cloudinit import log as logging
|
|
|
|
|
+
|
|
|
|
|
+LOG = logging.getLogger(__name__)
|
|
|
|
|
+
|
|
|
|
|
+class Distro(rhel.Distro):
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
|
|
+# vi: ts=4 expandtab
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
|
2023-07-12 15:58:59 +08:00
|
|
|
index 4c05f63..e686770 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/config/cloud.cfg.tmpl
|
|
|
|
|
+++ b/config/cloud.cfg.tmpl
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -35,7 +35,7 @@ disable_root: false
|
|
|
|
|
disable_root: true
|
2020-07-31 15:06:51 +08:00
|
|
|
{% endif %}
|
2022-07-28 16:58:38 +08:00
|
|
|
|
2023-07-12 15:58:59 +08:00
|
|
|
-{% if variant in ["alpine", "amazon", "fedora", "openEuler", "OpenCloudOS", "openmandriva", "photon", "TencentOS"] or is_rhel %}
|
|
|
|
|
+{% if variant in ["alpine", "amazon", "fedora", "openeuler", "OpenCloudOS", "openmandriva", "photon", "TencentOS"] or is_rhel %}
|
|
|
|
|
{% if is_rhel %}
|
2022-07-28 16:58:38 +08:00
|
|
|
mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2']
|
|
|
|
|
{% else %}
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -135,7 +135,7 @@ cloud_config_modules:
|
|
|
|
|
{% if is_rhel %}
|
2022-07-28 16:58:38 +08:00
|
|
|
- rh_subscription
|
2022-03-31 14:22:42 +08:00
|
|
|
{% endif %}
|
2023-07-12 15:58:59 +08:00
|
|
|
-{% if variant in ["fedora", "mariner", "openmandriva", "photon"] or is_rhel %}
|
|
|
|
|
+{% if variant in ["fedora", "mariner", "openmandriva", "photon", "openeuler"] or is_rhel %}
|
|
|
|
|
{% if variant not in ["mariner", "photon"] %}
|
2020-07-31 15:06:51 +08:00
|
|
|
- spacewalk
|
|
|
|
|
{% endif %}
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -199,7 +199,7 @@ cloud_final_modules:
|
2022-03-31 14:22:42 +08:00
|
|
|
system_info:
|
2020-07-31 15:06:51 +08:00
|
|
|
# This will affect which distro class gets used
|
2023-07-12 15:58:59 +08:00
|
|
|
{% if variant in ["alpine", "amazon", "arch", "debian", "fedora", "freebsd",
|
|
|
|
|
- "gentoo", "netbsd", "mariner", "openbsd", "openEuler", "OpenCloudOS",
|
|
|
|
|
+ "gentoo", "netbsd", "mariner", "openbsd", "openeuler", "OpenCloudOS",
|
|
|
|
|
"openmandriva", "photon", "suse", "TencentOS", "ubuntu"] or is_rhel %}
|
2020-07-31 15:06:51 +08:00
|
|
|
distro: {{ variant }}
|
2022-03-31 14:22:42 +08:00
|
|
|
{% elif variant in ["dragonfly"] %}
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -254,7 +254,7 @@ system_info:
|
2020-07-31 15:06:51 +08:00
|
|
|
security: http://ports.ubuntu.com/ubuntu-ports
|
|
|
|
|
ssh_svcname: ssh
|
2023-07-12 15:58:59 +08:00
|
|
|
{% elif variant in ["alpine", "amazon", "arch", "fedora",
|
|
|
|
|
- "gentoo", "openEuler", "OpenCloudOS", "openmandriva", "suse", "TencentOS"] or is_rhel %}
|
|
|
|
|
+ "gentoo", "openeuler", "OpenCloudOS", "openmandriva", "suse", "TencentOS"] or is_rhel %}
|
2020-07-31 15:06:51 +08:00
|
|
|
# Default user name + that default users groups (if added/used)
|
|
|
|
|
default_user:
|
2020-11-04 10:20:14 +08:00
|
|
|
{% if variant == "amazon" %}
|
2022-07-28 16:58:38 +08:00
|
|
|
diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl
|
2023-07-12 15:58:59 +08:00
|
|
|
index d71e3b8..783ae76 100644
|
2022-07-28 16:58:38 +08:00
|
|
|
--- a/systemd/cloud-init-generator.tmpl
|
|
|
|
|
+++ b/systemd/cloud-init-generator.tmpl
|
|
|
|
|
@@ -21,7 +21,7 @@ CLOUD_SYSTEM_TARGET="/usr/lib/systemd/system/cloud-init.target"
|
|
|
|
|
CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora",
|
2023-07-12 15:58:59 +08:00
|
|
|
- "miraclelinux", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "TencentOS", "virtuozzo"] %}
|
|
|
|
|
+ "miraclelinux", "openeuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "TencentOS", "virtuozzo"] %}
|
2022-07-28 16:58:38 +08:00
|
|
|
dsidentify="/usr/libexec/cloud-init/ds-identify"
|
|
|
|
|
{% else %}
|
|
|
|
|
dsidentify="/usr/lib/cloud-init/ds-identify"
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
|
2023-07-12 15:58:59 +08:00
|
|
|
index 1b1f9a8..c7a7c64 100644
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/systemd/cloud-init.service.tmpl
|
|
|
|
|
+++ b/systemd/cloud-init.service.tmpl
|
2022-03-31 14:22:42 +08:00
|
|
|
@@ -13,7 +13,7 @@ After=systemd-networkd-wait-online.service
|
2020-07-31 15:06:51 +08:00
|
|
|
After=networking.service
|
|
|
|
|
{% endif %}
|
2022-03-31 14:22:42 +08:00
|
|
|
{% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora",
|
2023-07-12 15:58:59 +08:00
|
|
|
- "miraclelinux", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky",
|
|
|
|
|
+ "miraclelinux", "openeuler", "OpenCloudOS", "openmandriva", "rhel", "rocky",
|
|
|
|
|
"suse", "TencentOS", "virtuozzo"] %}
|
|
|
|
|
|
2020-07-31 15:06:51 +08:00
|
|
|
After=network.service
|
2022-07-28 16:58:38 +08:00
|
|
|
diff --git a/tests/unittests/test_cli.py b/tests/unittests/test_cli.py
|
2023-07-12 15:58:59 +08:00
|
|
|
index e3fed41..2f031ee 100644
|
2022-07-28 16:58:38 +08:00
|
|
|
--- a/tests/unittests/test_cli.py
|
|
|
|
|
+++ b/tests/unittests/test_cli.py
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -246,7 +246,7 @@ class TestCLI:
|
|
|
|
|
"**Supported distros:** almalinux, alpine, centos, "
|
|
|
|
|
"cloudlinux, cos, debian, eurolinux, fedora, freebsd, "
|
|
|
|
|
"mariner, miraclelinux, "
|
|
|
|
|
- "openbsd, openEuler, OpenCloudOS, openmandriva, "
|
|
|
|
|
+ "openbsd, openeuler, OpenCloudOS, openmandriva, "
|
|
|
|
|
"opensuse, opensuse-microos, opensuse-tumbleweed, "
|
|
|
|
|
"opensuse-leap, photon, rhel, rocky, sle_hpc, "
|
|
|
|
|
"sle-micro, sles, TencentOS, ubuntu, virtuozzo",
|
2020-07-31 15:06:51 +08:00
|
|
|
diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg
|
2023-07-12 15:58:59 +08:00
|
|
|
index 6551875..b21fdee 100755
|
2020-07-31 15:06:51 +08:00
|
|
|
--- a/tools/render-cloudcfg
|
|
|
|
|
+++ b/tools/render-cloudcfg
|
2023-07-12 15:58:59 +08:00
|
|
|
@@ -25,7 +25,7 @@ def main():
|
2022-03-31 14:22:42 +08:00
|
|
|
"miraclelinux",
|
|
|
|
|
"netbsd",
|
|
|
|
|
"openbsd",
|
|
|
|
|
- "openEuler",
|
|
|
|
|
+ "openeuler",
|
2023-07-12 15:58:59 +08:00
|
|
|
"OpenCloudOS",
|
|
|
|
|
"openmandriva",
|
2022-03-31 14:22:42 +08:00
|
|
|
"photon",
|
|
|
|
|
--
|
2022-07-28 16:58:38 +08:00
|
|
|
2.27.0
|
2022-03-31 14:22:42 +08:00
|
|
|
|