Update patch

i8 changed/i8/cloud-init-23.1.1-10.el8.inferit
Arkady L. Shane 1 year ago
parent 89506737ea
commit 5256bf06bb
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -1,58 +1,59 @@
From 31f7e214bf94eb09baa49903c089ff6f64e1fef3 Mon Sep 17 00:00:00 2001 From ab2dc25043d9782b1fa80777e55bd83093538b7f Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere.ru> From: tigro <tigro@msvsphere-os.ru>
Date: Thu, 31 Aug 2023 13:02:56 +0300 Date: Thu, 21 Dec 2023 13:36:28 +0300
Subject: [PATCH] Add MSVSphere support Subject: [PATCH] Add MSVSphere support
--- ---
README.md | 2 +- README.md | 2 +-
cloudinit/config/cc_ca_certs.py | 9 +++- cloudinit/config/cc_ca_certs.py | 8 ++++
cloudinit/config/cc_ntp.py | 9 ++++ cloudinit/config/cc_ntp.py | 9 ++++
cloudinit/config/cc_yum_add_repo.py | 3 +- cloudinit/config/cc_yum_add_repo.py | 1 +
cloudinit/distros/__init__.py | 1 + cloudinit/distros/__init__.py | 1 +
cloudinit/distros/msvsphere.py | 10 ++++ cloudinit/distros/msvsphere.py | 10 ++++
cloudinit/net/sysconfig.py | 1 + cloudinit/net/sysconfig.py | 1 +
cloudinit/settings.py | 2 +- cloudinit/settings.py | 2 +-
cloudinit/sources/DataSourceRbxCloud.py | 2 +- cloudinit/sources/DataSourceRbxCloud.py | 2 +-
cloudinit/util.py | 1 + cloudinit/util.py | 1 +
config/cloud.cfg.tmpl | 6 +-- config/cloud.cfg.tmpl | 2 +-
doc/rtd/topics/availability.rst | 2 +- doc/rtd/reference/availability.rst | 2 +-
doc/rtd/reference/network-config.rst | 4 +-
packages/pkg-deps.json | 14 ++++++ packages/pkg-deps.json | 14 ++++++
systemd/cloud-config.service.tmpl | 2 +- systemd/cloud-config.service.tmpl | 2 +-
systemd/cloud-final.service.tmpl | 4 +- systemd/cloud-final.service.tmpl | 4 +-
systemd/cloud-init-generator.tmpl | 2 +- systemd/cloud-init-generator.tmpl | 2 +-
systemd/cloud-init-local.service.tmpl | 10 ++-- systemd/cloud-init-local.service.tmpl | 12 ++---
systemd/cloud-init.service.tmpl | 6 +-- systemd/cloud-init.service.tmpl | 6 +--
templates/chrony.conf.msvsphere.tmpl | 45 ++++++++++++++++++ templates/chrony.conf.msvsphere.tmpl | 45 ++++++++++++++++++
templates/ntp.conf.msvsphere.tmpl | 61 +++++++++++++++++++++++++ templates/ntp.conf.msvsphere.tmpl | 61 +++++++++++++++++++++++++
tests/unittests/test_net.py | 1 + tests/unittests/test_net.py | 1 +
tests/unittests/test_render_cloudcfg.py | 1 + tests/unittests/test_render_cloudcfg.py | 1 +
tests/unittests/test_util.py | 45 ++++++++++++++++++ tests/unittests/test_util.py | 44 ++++++++++++++++++
tools/read-dependencies | 8 +++- tools/read-dependencies | 7 ++-
tools/render-cloudcfg | 1 + tools/render-cloudcfg | 1 +
tools/run-container | 6 +-- tools/run-container | 8 ++--
26 files changed, 228 insertions(+), 26 deletions(-) 27 files changed, 228 insertions(+), 25 deletions(-)
create mode 100644 cloudinit/distros/msvsphere.py create mode 100644 cloudinit/distros/msvsphere.py
create mode 100644 templates/chrony.conf.msvsphere.tmpl create mode 100644 templates/chrony.conf.msvsphere.tmpl
create mode 100644 templates/ntp.conf.msvsphere.tmpl create mode 100644 templates/ntp.conf.msvsphere.tmpl
diff --git a/README.md b/README.md diff --git a/README.md b/README.md
index f2a745f..fa81a83 100644 index 45a5bd9..fff93c9 100644
--- a/README.md --- a/README.md
+++ b/README.md +++ b/README.md
@@ -39,7 +39,7 @@ get in contact with that distribution and send them our way! @@ -39,7 +39,7 @@ get in contact with that distribution and send them our way!
| Supported OSes | Supported Public Clouds | Supported Private Clouds | | Supported OSes | Supported Public Clouds | Supported Private Clouds |
| --- | --- | --- | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| --- | --- |
-| Alpine Linux<br />ArchLinux<br />Debian<br />DragonFlyBSD<br />Fedora<br />FreeBSD<br />Gentoo Linux<br />NetBSD<br />OpenBSD<br />openEuler<br />RHEL/CentOS/AlmaLinux/Rocky/PhotonOS/Virtuozzo/EuroLinux/CloudLinux/MIRACLE LINUX<br />SLES/openSUSE<br />Ubuntu<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> | Amazon Web Services<br />Microsoft Azure<br />Google Cloud Platform<br />Oracle Cloud Infrastructure<br />Softlayer<br />Rackspace Public Cloud<br />IBM Cloud<br />DigitalOcean<br />Bigstep<br />Hetzner<br />Joyent<br />CloudSigma<br />Alibaba Cloud<br />OVH<br />OpenNebula<br />Exoscale<br />Scaleway<br />CloudStack<br />AltCloud<br />SmartOS<br />HyperOne<br />Vultr<br />Rootbox<br /> | Bare metal installs<br />OpenStack<br />LXD<br />KVM<br />Metal-as-a-Service (MAAS)<br />VMware<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />| -| Alpine Linux<br />Arch Linux<br />Container-Optimized OS<br />Debian<br />DragonFlyBSD<br />Fedora<br />FreeBSD<br />Gentoo Linux<br />NetBSD<br />OpenBSD<br />openEuler<br />OpenCloudOS<br />OpenMandriva<br />RHEL/CentOS/AlmaLinux/Rocky/PhotonOS/Virtuozzo/EuroLinux/CloudLinux/MIRACLE LINUX/MarinerOS<br />SLES/openSUSE<br />TencentOS<br />Ubuntu<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> | Amazon Web Services<br />Microsoft Azure<br />Google Cloud Platform<br />Oracle Cloud Infrastructure<br />Softlayer<br />Rackspace Public Cloud<br />IBM Cloud<br />DigitalOcean<br />Bigstep<br />Hetzner<br />Joyent<br />CloudSigma<br />Alibaba Cloud<br />Huawei Cloud<br />OVH<br />OpenNebula<br />Exoscale<br />Scaleway<br />CloudStack<br />AltCloud<br />SmartOS<br />HyperOne<br />Vultr<br />Rootbox<br /> | Bare metal installs<br />OpenStack<br />LXD<br />KVM<br />Metal-as-a-Service (MAAS)<br />VMware<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />|
+| Alpine Linux<br />ArchLinux<br />Debian<br />DragonFlyBSD<br />Fedora<br />FreeBSD<br />Gentoo Linux<br />NetBSD<br />OpenBSD<br />openEuler<br />RHEL/CentOS/AlmaLinux/Rocky/PhotonOS/Virtuozzo/EuroLinux/CloudLinux/MIRACLE LINUX/MSVSphere<br />SLES/openSUSE<br />Ubuntu<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> | Amazon Web Services<br />Microsoft Azure<br />Google Cloud Platform<br />Oracle Cloud Infrastructure<br />Softlayer<br />Rackspace Public Cloud<br />IBM Cloud<br />DigitalOcean<br />Bigstep<br />Hetzner<br />Joyent<br />CloudSigma<br />Alibaba Cloud<br />OVH<br />OpenNebula<br />Exoscale<br />Scaleway<br />CloudStack<br />AltCloud<br />SmartOS<br />HyperOne<br />Vultr<br />Rootbox<br /> | Bare metal installs<br />OpenStack<br />LXD<br />KVM<br />Metal-as-a-Service (MAAS)<br />VMware<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />| +| Alpine Linux<br />Arch Linux<br />Container-Optimized OS<br />Debian<br />DragonFlyBSD<br />Fedora<br />FreeBSD<br />Gentoo Linux<br />NetBSD<br />OpenBSD<br />openEuler<br />OpenCloudOS<br />OpenMandriva<br />RHEL/CentOS/AlmaLinux/Rocky/PhotonOS/Virtuozzo/EuroLinux/CloudLinux/MIRACLE LINUX/MarinerOS/MSVSphere<br />SLES/openSUSE<br />TencentOS<br />Ubuntu<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> | Amazon Web Services<br />Microsoft Azure<br />Google Cloud Platform<br />Oracle Cloud Infrastructure<br />Softlayer<br />Rackspace Public Cloud<br />IBM Cloud<br />DigitalOcean<br />Bigstep<br />Hetzner<br />Joyent<br />CloudSigma<br />Alibaba Cloud<br />Huawei Cloud<br />OVH<br />OpenNebula<br />Exoscale<br />Scaleway<br />CloudStack<br />AltCloud<br />SmartOS<br />HyperOne<br />Vultr<br />Rootbox<br /> | Bare metal installs<br />OpenStack<br />LXD<br />KVM<br />Metal-as-a-Service (MAAS)<br />VMware<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />|
## To start developing cloud-init ## To start developing cloud-init
diff --git a/cloudinit/config/cc_ca_certs.py b/cloudinit/config/cc_ca_certs.py diff --git a/cloudinit/config/cc_ca_certs.py b/cloudinit/config/cc_ca_certs.py
index 6084cb4..150076b 100644 index 4dc0868..4191c72 100644
--- a/cloudinit/config/cc_ca_certs.py --- a/cloudinit/config/cc_ca_certs.py
+++ b/cloudinit/config/cc_ca_certs.py +++ b/cloudinit/config/cc_ca_certs.py
@@ -19,6 +19,13 @@ DEFAULT_CONFIG = { @@ -25,6 +25,13 @@ DEFAULT_CONFIG = {
"ca_cert_update_cmd": ["update-ca-certificates"], "ca_cert_update_cmd": ["update-ca-certificates"],
} }
DISTRO_OVERRIDES = { DISTRO_OVERRIDES = {
@ -64,31 +65,30 @@ index 6084cb4..150076b 100644
+ "ca_cert_update_cmd": ["update-ca-trust"], + "ca_cert_update_cmd": ["update-ca-trust"],
+ }, + },
"rhel": { "rhel": {
"ca_cert_path": "/usr/share/pki/ca-trust-source/", "ca_cert_path": "/etc/pki/ca-trust/",
"ca_cert_filename": "anchors/cloud-init-ca-certs.crt", "ca_cert_local_path": "/usr/share/pki/ca-trust-source/",
@@ -43,7 +50,7 @@ can be removed from the system with the configuration option @@ -68,6 +75,7 @@ configuration option ``remove_defaults``.
ca-certificates package is installed but not if the distros = [
ca-certificates-bundle package is installed. "alpine",
""" "debian",
-distros = ["alpine", "debian", "ubuntu", "rhel"] + "msvsphere",
+distros = ["alpine", "debian", "ubuntu", "msvsphere", "rhel"] "rhel",
"opensuse",
meta: MetaSchema = { "opensuse-microos",
"id": "cc_ca_certs",
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index 25bba76..6de1d85 100644 index b5620f3..0e437ac 100644
--- a/cloudinit/config/cc_ntp.py --- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py +++ b/cloudinit/config/cc_ntp.py
@@ -33,6 +33,7 @@ distros = [ @@ -35,6 +35,7 @@ distros = [
"eurolinux", "freebsd",
"fedora", "mariner",
"miraclelinux", "miraclelinux",
+ "msvsphere", + "msvsphere",
"openbsd",
"openEuler", "openEuler",
"opensuse", "OpenCloudOS",
"photon", @@ -158,6 +159,14 @@ DISTRO_CLIENT_CONFIG = {
@@ -96,6 +97,14 @@ DISTRO_CLIENT_CONFIG = { "confpath": "/etc/systemd/timesyncd.conf",
"confpath": "/etc/chrony/chrony.conf",
}, },
}, },
+ "msvsphere": { + "msvsphere": {
@ -99,42 +99,33 @@ index 25bba76..6de1d85 100644
+ "service_name": "chronyd", + "service_name": "chronyd",
+ }, + },
+ }, + },
"opensuse": { "openbsd": {
"chrony": { "openntpd": {},
"service_name": "chronyd", },
diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py
index 7a23268..58e938e 100644 index 3087b22..0222073 100644
--- a/cloudinit/config/cc_yum_add_repo.py --- a/cloudinit/config/cc_yum_add_repo.py
+++ b/cloudinit/config/cc_yum_add_repo.py +++ b/cloudinit/config/cc_yum_add_repo.py
@@ -19,7 +19,7 @@ entry, the config entry will be skipped. @@ -32,6 +32,7 @@ distros = [
**Module frequency:** always
**Supported distros:** almalinux, centos, cloudlinux, eurolinux, fedora,
- miraclelinux, openEuler, photon, rhel, rocky, virtuozzo
+ miraclelinux, msvsphere, openEuler, photon, rhel, rocky, virtuozzo
**Config keys**::
@@ -43,6 +43,7 @@ distros = [
"cloudlinux",
"eurolinux", "eurolinux",
"fedora", "fedora",
"mariner",
+ "msvsphere", + "msvsphere",
"openEuler", "openEuler",
"photon", "OpenCloudOS",
"rhel", "openmandriva",
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 76acd6a..8d973d4 100755 index 12fae0a..30c5845 100644
--- a/cloudinit/distros/__init__.py --- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py
@@ -45,6 +45,7 @@ OSFAMILIES = { @@ -57,6 +57,7 @@ OSFAMILIES = {
"cloudlinux",
"eurolinux",
"fedora", "fedora",
+ "msvsphere", "mariner",
"miraclelinux", "miraclelinux",
"openEuler", + "msvsphere",
"openmandriva",
"photon", "photon",
"rhel",
diff --git a/cloudinit/distros/msvsphere.py b/cloudinit/distros/msvsphere.py diff --git a/cloudinit/distros/msvsphere.py b/cloudinit/distros/msvsphere.py
new file mode 100644 new file mode 100644
index 0000000..3dc0a34 index 0000000..3dc0a34
@ -152,22 +143,22 @@ index 0000000..3dc0a34
+ +
+# vi: ts=4 expandtab +# vi: ts=4 expandtab
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index 362e8d1..aa5602c 100644 index 421564e..23dc211 100644
--- a/cloudinit/net/sysconfig.py --- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py
@@ -27,6 +27,7 @@ KNOWN_DISTROS = [ @@ -27,6 +27,7 @@ KNOWN_DISTROS = [
"cloudlinux",
"eurolinux", "eurolinux",
"fedora", "fedora",
+ "msvsphere",
"miraclelinux", "miraclelinux",
+ "msvsphere",
"openEuler", "openEuler",
"rhel", "OpenCloudOS",
"openmandriva",
diff --git a/cloudinit/settings.py b/cloudinit/settings.py diff --git a/cloudinit/settings.py b/cloudinit/settings.py
index 71672e1..3c3d949 100644 index a36c518..b118df6 100644
--- a/cloudinit/settings.py --- a/cloudinit/settings.py
+++ b/cloudinit/settings.py +++ b/cloudinit/settings.py
@@ -58,7 +58,7 @@ CFG_BUILTIN = { @@ -62,7 +62,7 @@ CFG_BUILTIN = {
"cloud_dir": "/var/lib/cloud", "cloud_dir": "/var/lib/cloud",
"templates_dir": "/etc/cloud/templates/", "templates_dir": "/etc/cloud/templates/",
}, },
@ -177,10 +168,10 @@ index 71672e1..3c3d949 100644
}, },
"vendor_data": {"enabled": True, "prefix": []}, "vendor_data": {"enabled": True, "prefix": []},
diff --git a/cloudinit/sources/DataSourceRbxCloud.py b/cloudinit/sources/DataSourceRbxCloud.py diff --git a/cloudinit/sources/DataSourceRbxCloud.py b/cloudinit/sources/DataSourceRbxCloud.py
index 14ac77e..55d6724 100644 index 6890562..d87e0df 100644
--- a/cloudinit/sources/DataSourceRbxCloud.py --- a/cloudinit/sources/DataSourceRbxCloud.py
+++ b/cloudinit/sources/DataSourceRbxCloud.py +++ b/cloudinit/sources/DataSourceRbxCloud.py
@@ -55,7 +55,7 @@ def _sub_arp(cmd): @@ -60,7 +60,7 @@ def _sub_arp(cmd):
def gratuitous_arp(items, distro): def gratuitous_arp(items, distro):
source_param = "-S" source_param = "-S"
@ -190,53 +181,35 @@ index 14ac77e..55d6724 100644
for item in items: for item in items:
try: try:
diff --git a/cloudinit/util.py b/cloudinit/util.py diff --git a/cloudinit/util.py b/cloudinit/util.py
index 569fc21..7348a64 100644 index 00892d6..1cd5522 100644
--- a/cloudinit/util.py --- a/cloudinit/util.py
+++ b/cloudinit/util.py +++ b/cloudinit/util.py
@@ -583,6 +583,7 @@ def _get_variant(info): @@ -638,6 +638,7 @@ def _get_variant(info):
"debian",
"eurolinux", "eurolinux",
"fedora", "fedora",
"mariner",
+ "msvsphere", + "msvsphere",
"miraclelinux", "miraclelinux",
"openeuler", "openeuler",
"photon", "opencloudos",
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
index 08b6efb..b5fed23 100644 index 020340f..7cd3336 100644
--- a/config/cloud.cfg.tmpl --- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl +++ b/config/cloud.cfg.tmpl
@@ -34,7 +34,7 @@ disable_root: true @@ -4,7 +4,7 @@
{% endif %} # and base configuration.
{% set is_bsd = variant in ["dragonfly", "freebsd", "netbsd", "openbsd"] %}
{% if variant in ["almalinux", "alpine", "amazon", "cloudlinux", "eurolinux", {% set is_rhel = variant in ["almalinux", "centos", "cloudlinux", "eurolinux",
- "fedora", "miraclelinux", "openEuler", "openmandriva", "rocky", "virtuozzo"] or is_rhel %} - "miraclelinux", "rhel", "rocky", "virtuozzo" ] %}
+ "fedora", "miraclelinux", "msvsphere", "openEuler", "openmandriva", "rocky", "virtuozzo"] or is_rhel %} + "miraclelinux", "msvsphere", "rhel", "rocky", "virtuozzo" ] %}
{% if is_rhel %} {% if is_bsd %}
mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2'] syslog_fix_perms: root:wheel
{% else %} {% elif variant in ["suse"] %}
@@ -195,7 +195,7 @@ cloud_final_modules: diff --git a/doc/rtd/reference/availability.rst b/doc/rtd/reference/availability.rst
system_info: index b70342a..8137508 100644
# This will affect which distro class gets used --- a/doc/rtd/reference/availability.rst
{% if variant in ["almalinux", "alpine", "amazon", "arch", "cloudlinux", "debian", +++ b/doc/rtd/reference/availability.rst
- "eurolinux", "fedora", "freebsd", "gentoo", "netbsd", "miraclelinux", "openbsd", "openEuler", @@ -27,7 +27,7 @@ NetBSD, OpenBSD and DragonFlyBSD:
+ "eurolinux", "fedora", "freebsd", "gentoo", "netbsd", "miraclelinux", "msvsphere", "openbsd", "openEuler",
"openmandriva", "photon", "rocky", "suse", "ubuntu", "virtuozzo"] or is_rhel %}
distro: {{ variant }}
{% elif variant in ["dragonfly"] %}
@@ -250,7 +250,7 @@ system_info:
security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
{% elif variant in ["almalinux", "alpine", "amazon", "arch", "cloudlinux", "eurolinux",
- "fedora", "gentoo", "miraclelinux", "openEuler", "openmandriva", "rocky", "suse", "virtuozzo"] or is_rhel %}
+ "fedora", "gentoo", "miraclelinux", "msvsphere", "openEuler", "openmandriva", "rocky", "suse", "virtuozzo"] or is_rhel %}
# Default user name + that default users groups (if added/used)
default_user:
{% if variant == "amazon" %}
diff --git a/doc/rtd/topics/availability.rst b/doc/rtd/topics/availability.rst
index d8ca9d1..8a5e604 100644
--- a/doc/rtd/topics/availability.rst
+++ b/doc/rtd/topics/availability.rst
@@ -27,7 +27,7 @@ OpenBSD and DragonFlyBSD:
- NetBSD - NetBSD
- OpenBSD - OpenBSD
- Photon OS - Photon OS
@ -245,8 +218,30 @@ index d8ca9d1..8a5e604 100644
- SLES/openSUSE - SLES/openSUSE
- Ubuntu - Ubuntu
diff --git a/doc/rtd/reference/network-config.rst b/doc/rtd/reference/network-config.rst
index ea331f1..08dcca9 100644
--- a/doc/rtd/reference/network-config.rst
+++ b/doc/rtd/reference/network-config.rst
@@ -267,7 +267,7 @@ Example output:
.. code-block::
usage: /usr/bin/cloud-init devel net-convert [-h] -p PATH -k {eni,network_data.json,yaml,azure-imds,vmware-imc} -d PATH -D
- {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}
+ {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,msvsphere,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}
[-m name,mac] [--debug] -O {eni,netplan,networkd,sysconfig,network-manager}
options:
@@ -278,7 +278,7 @@ Example output:
The format of the given network config
-d PATH, --directory PATH
directory to place output in
- -D {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}, --distro {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}
+ -D {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,msvsphere,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}, --distro {alpine,arch,debian,ubuntu,freebsd,dragonfly,gentoo,cos,netbsd,openbsd,almalinux,amazon,centos,cloudlinux,eurolinux,fedora,mariner,miraclelinux,msvsphere,openmandriva,photon,rhel,rocky,virtuozzo,opensuse,sles,openEuler}
-m name,mac, --mac name,mac
interface name to mac mapping
--debug enable debug logging to stderr.
diff --git a/packages/pkg-deps.json b/packages/pkg-deps.json diff --git a/packages/pkg-deps.json b/packages/pkg-deps.json
index eaf1346..e12ab07 100644 index 4ee0982..df7596c 100644
--- a/packages/pkg-deps.json --- a/packages/pkg-deps.json
+++ b/packages/pkg-deps.json +++ b/packages/pkg-deps.json
@@ -41,6 +41,20 @@ @@ -41,6 +41,20 @@
@ -271,7 +266,7 @@ index eaf1346..e12ab07 100644
"build-requires" : [ "build-requires" : [
"python3-devel" "python3-devel"
diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl
index d5568a6..81d4c9d 100644 index d5568a6..954a85b 100644
--- a/systemd/cloud-config.service.tmpl --- a/systemd/cloud-config.service.tmpl
+++ b/systemd/cloud-config.service.tmpl +++ b/systemd/cloud-config.service.tmpl
@@ -4,7 +4,7 @@ Description=Apply the settings specified in cloud-config @@ -4,7 +4,7 @@ Description=Apply the settings specified in cloud-config
@ -279,12 +274,12 @@ index d5568a6..81d4c9d 100644
After=snapd.seeded.service After=snapd.seeded.service
Wants=network-online.target cloud-config.target Wants=network-online.target cloud-config.target
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled ConditionKernelCommandLine=!cloud-init=disabled
{% endif %} {% endif %}
diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl
index 85f423a..10b7e72 100644 index 85f423a..9fe04af 100644
--- a/systemd/cloud-final.service.tmpl --- a/systemd/cloud-final.service.tmpl
+++ b/systemd/cloud-final.service.tmpl +++ b/systemd/cloud-final.service.tmpl
@@ -7,7 +7,7 @@ After=multi-user.target @@ -7,7 +7,7 @@ After=multi-user.target
@ -292,7 +287,7 @@ index 85f423a..10b7e72 100644
{% endif %} {% endif %}
Wants=network-online.target cloud-config.service Wants=network-online.target cloud-config.service
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled ConditionKernelCommandLine=!cloud-init=disabled
{% endif %} {% endif %}
@ -301,25 +296,25 @@ index 85f423a..10b7e72 100644
TimeoutSec=0 TimeoutSec=0
KillMode=process KillMode=process
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
# Restart NetworkManager if it is present and running. # Restart NetworkManager if it is present and running.
ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \ ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
out=$(systemctl show --property=SubState $u) || exit; \ out=$(systemctl show --property=SubState $u) || exit; \
diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl
index 74d4742..0d39ed0 100644 index d71e3b8..7c25028 100644
--- a/systemd/cloud-init-generator.tmpl --- a/systemd/cloud-init-generator.tmpl
+++ b/systemd/cloud-init-generator.tmpl +++ b/systemd/cloud-init-generator.tmpl
@@ -84,7 +84,7 @@ default() { @@ -21,7 +21,7 @@ CLOUD_SYSTEM_TARGET="/usr/lib/systemd/system/cloud-init.target"
check_for_datasource() { CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
local ds_rc="" {% endif %}
{% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora", {% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora",
- "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %} - "miraclelinux", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "TencentOS", "virtuozzo"] %}
+ "miraclelinux", "msvsphere", "openEuler", "rhel", "rocky", "virtuozzo"] %} + "miraclelinux", "msvsphere", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky", "TencentOS", "virtuozzo"] %}
local dsidentify="/usr/libexec/cloud-init/ds-identify" dsidentify="/usr/libexec/cloud-init/ds-identify"
{% else %} {% else %}
local dsidentify="/usr/lib/cloud-init/ds-identify" dsidentify="/usr/lib/cloud-init/ds-identify"
diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
index a6b8265..70f1a9b 100644 index 6f3f9d8..1983f9b 100644
--- a/systemd/cloud-init-local.service.tmpl --- a/systemd/cloud-init-local.service.tmpl
+++ b/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
@ -334,33 +329,41 @@ index a6b8265..70f1a9b 100644
After=hv_kvp_daemon.service After=hv_kvp_daemon.service
After=systemd-remount-fs.service After=systemd-remount-fs.service
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
Requires=dbus.socket Requires=dbus.socket
After=dbus.socket After=dbus.socket
{% endif %} {% endif %}
Before=NetworkManager.service Before=NetworkManager.service
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
Before=network.service Before=network.service
{% endif %} {% endif %}
Before=network-pre.target Before=network-pre.target
Before=shutdown.target Before=shutdown.target
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
Before=firewalld.target Before=firewalld.target
Conflicts=shutdown.target Conflicts=shutdown.target
{% endif %} {% endif %}
@@ -33,7 +33,7 @@ ConditionKernelCommandLine=!cloud-init=disabled @@ -26,14 +26,14 @@ Before=sysinit.target
Conflicts=shutdown.target
{% endif %}
RequiresMountsFor=/var/lib/cloud
-{% if variant == "rhel" %}
+{% if variant == ["msvsphere", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
{% endif %}
[Service] [Service]
Type=oneshot Type=oneshot
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
ExecStartPre=/bin/mkdir -p /run/cloud-init ExecStartPre=/bin/mkdir -p /run/cloud-init
ExecStartPre=/sbin/restorecon /run/cloud-init ExecStartPre=/sbin/restorecon /run/cloud-init
ExecStartPre=/usr/bin/touch /run/cloud-init/enabled ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
index fc984d5..acab0e8 100644 index 1b1f9a8..70522ca 100644
--- a/systemd/cloud-init.service.tmpl --- a/systemd/cloud-init.service.tmpl
+++ b/systemd/cloud-init.service.tmpl +++ b/systemd/cloud-init.service.tmpl
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
@ -376,17 +379,17 @@ index fc984d5..acab0e8 100644
After=networking.service After=networking.service
{% endif %} {% endif %}
{% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora", {% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora",
- "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %} - "miraclelinux", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky",
+ "miraclelinux", "msvsphere", "openEuler", "rhel", "rocky", "virtuozzo"] %} + "miraclelinux", "msvsphere", "openEuler", "OpenCloudOS", "openmandriva", "rhel", "rocky",
"suse", "TencentOS", "virtuozzo"] %}
After=network.service After=network.service
After=NetworkManager.service @@ -39,7 +39,7 @@ Before=shutdown.target
After=NetworkManager-wait-online.service
@@ -37,7 +37,7 @@ Before=shutdown.target
Conflicts=shutdown.target Conflicts=shutdown.target
{% endif %} {% endif %}
Before=systemd-user-sessions.service Before=systemd-user-sessions.service
-{% if variant == "rhel" %} -{% if variant == "rhel" %}
+{% if variant in ["msvsphere", "rhel"] %} +{% if variant == ["msvsphere", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled ConditionKernelCommandLine=!cloud-init=disabled
{% endif %} {% endif %}
@ -509,10 +512,10 @@ index 0000000..62b4776
+# Enable writing of statistics records. +# Enable writing of statistics records.
+#statistics clockstats cryptostats loopstats peerstats +#statistics clockstats cryptostats loopstats peerstats
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 591241b..51b06c8 100644 index aa4098b..e167c65 100644
--- a/tests/unittests/test_net.py --- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py
@@ -6259,6 +6259,7 @@ class TestNetRenderers(CiTestCase): @@ -7841,6 +7841,7 @@ class TestNetRenderers(CiTestCase):
"eurolinux", "eurolinux",
"fedora", "fedora",
"rhel", "rhel",
@ -521,7 +524,7 @@ index 591241b..51b06c8 100644
for distro_name in variants: for distro_name in variants:
m_info.return_value = {"variant": distro_name} m_info.return_value = {"variant": distro_name}
diff --git a/tests/unittests/test_render_cloudcfg.py b/tests/unittests/test_render_cloudcfg.py diff --git a/tests/unittests/test_render_cloudcfg.py b/tests/unittests/test_render_cloudcfg.py
index 1a6e271..aa322ee 100644 index d3aeb1b..51cd167 100644
--- a/tests/unittests/test_render_cloudcfg.py --- a/tests/unittests/test_render_cloudcfg.py
+++ b/tests/unittests/test_render_cloudcfg.py +++ b/tests/unittests/test_render_cloudcfg.py
@@ -17,6 +17,7 @@ DISTRO_VARIANTS = [ @@ -17,6 +17,7 @@ DISTRO_VARIANTS = [
@ -529,55 +532,55 @@ index 1a6e271..aa322ee 100644
"freebsd", "freebsd",
"gentoo", "gentoo",
+ "msvsphere", + "msvsphere",
"mariner",
"netbsd", "netbsd",
"openbsd", "openbsd",
"photon",
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 3765511..b1ee240 100644 index af96da0..2cff14a 100644
--- a/tests/unittests/test_util.py --- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py
@@ -201,6 +201,28 @@ OS_RELEASE_MIRACLELINUX_8 = dedent( @@ -209,6 +209,28 @@ OS_RELEASE_MIRACLELINUX_8 = dedent(
""" """
) )
+OS_RELEASE_MSVSPHERE_8 = dedent( +OS_RELEASE_MSVSPHERE_8 = dedent(
+ """\ + """\
+ NAME="MSVSphere" + NAME="MSVSphere"
+ VERSION="8.8 (Inferit)" + VERSION="8.9 (Inferit)"
+ ID="msvsphere" + ID="msvsphere"
+ ID_LIKE="rhel centos fedora" + ID_LIKE="rhel centos fedora"
+ VERSION_ID="8.8" + VERSION_ID="8.9"
+ PLATFORM_ID="platform:el8" + PLATFORM_ID="platform:el8"
+ PRETTY_NAME="MSVSphere 8.8 (Inferit)" + PRETTY_NAME="MSVSphere 8.9 (Inferit)"
+ ANSI_COLOR="0;34" + ANSI_COLOR="1;35"
+ LOGO="fedora-logo-icon" + LOGO="fedora-logo-icon"
+ CPE_NAME="cpe:/o:ncsd:msvsphere:8::baseos" + CPE_NAME="cpe:/o:ncsd:msvsphere:8::baseos"
+ HOME_URL="https://msvsphere.ru/" + HOME_URL="https://msvsphere-os.ru/"
+ BUG_REPORT_URL="https://bugs.msvsphere.ru/" + BUG_REPORT_URL="https://bugs.msvsphere-os.ru/"
+ +
+ MSVSPHERE_MANTISBT_PROJECT="MSVSphere-8" + MSVSPHERE_MANTISBT_PROJECT="MSVSphere-8"
+ MSVSPHERE_MANTISBT_PROJECT_VERSION="8.8" + MSVSPHERE_MANTISBT_PROJECT_VERSION="8.9"
+ REDHAT_SUPPORT_PRODUCT="MSVSphere" + REDHAT_SUPPORT_PRODUCT="MSVSphere"
+ REDHAT_SUPPORT_PRODUCT_VERSION="8.8" + REDHAT_SUPPORT_PRODUCT_VERSION="8.9"
+""" +"""
+) +)
+ +
OS_RELEASE_ROCKY_8 = dedent( OS_RELEASE_ROCKY_8 = dedent(
"""\ """\
NAME="Rocky Linux" NAME="Rocky Linux"
@@ -272,6 +294,7 @@ REDHAT_RELEASE_ALMALINUX_8 = "AlmaLinux release 8.3 (Purple Manul)" @@ -310,6 +332,7 @@ REDHAT_RELEASE_ALMALINUX_8 = "AlmaLinux release 8.3 (Purple Manul)"
REDHAT_RELEASE_EUROLINUX_7 = "EuroLinux release 7.9 (Minsk)" REDHAT_RELEASE_EUROLINUX_7 = "EuroLinux release 7.9 (Minsk)"
REDHAT_RELEASE_EUROLINUX_8 = "EuroLinux release 8.4 (Vaduz)" REDHAT_RELEASE_EUROLINUX_8 = "EuroLinux release 8.4 (Vaduz)"
REDHAT_RELEASE_MIRACLELINUX_8 = "MIRACLE LINUX release 8.4 (Peony)" REDHAT_RELEASE_MIRACLELINUX_8 = "MIRACLE LINUX release 8.4 (Peony)"
+REDHAT_RELEASE_MSVSPHERE_8 = "MSVSphere release 8.8 (Inferit)" +REDHAT_RELEASE_MSVSPHERE_8 = "MSVSphere release 8.9 (Inferit)"
REDHAT_RELEASE_ROCKY_8 = "Rocky Linux release 8.3 (Green Obsidian)" REDHAT_RELEASE_ROCKY_8 = "Rocky Linux release 8.3 (Green Obsidian)"
REDHAT_RELEASE_VIRTUOZZO_8 = "Virtuozzo Linux release 8" REDHAT_RELEASE_VIRTUOZZO_8 = "Virtuozzo Linux release 8"
REDHAT_RELEASE_CLOUDLINUX_8 = "CloudLinux release 8.4 (Valery Rozhdestvensky)" REDHAT_RELEASE_CLOUDLINUX_8 = "CloudLinux release 8.4 (Valery Rozhdestvensky)"
@@ -791,6 +814,27 @@ class TestGetLinuxDistro(CiTestCase): @@ -1096,6 +1119,26 @@ class TestGetLinuxDistro(CiTestCase):
dist = util.get_linux_distro() dist = util.get_linux_distro()
self.assertEqual(("miraclelinux", "8", "Peony"), dist) self.assertEqual(("miraclelinux", "8", "Peony"), dist)
+ @mock.patch("cloudinit.util.load_file") + @mock.patch(M_PATH + "load_file")
+ def test_get_linux_msvsphere8_rhrelease( + def test_get_linux_msvsphere8_rhrelease(
+ self, m_os_release, m_path_exists + self, m_os_release, m_path_exists
+ ): + ):
@ -585,9 +588,9 @@ index 3765511..b1ee240 100644
+ m_os_release.return_value = REDHAT_RELEASE_MSVSPHERE_8 + m_os_release.return_value = REDHAT_RELEASE_MSVSPHERE_8
+ m_path_exists.side_effect = TestGetLinuxDistro.redhat_release_exists + m_path_exists.side_effect = TestGetLinuxDistro.redhat_release_exists
+ dist = util.get_linux_distro() + dist = util.get_linux_distro()
+ self.assertEqual(("msvsphere", "8.8", "Inferit"), dist) + self.assertEqual(("msvsphere", "8.9", "Inferit"), dist)
+ +
+ @mock.patch("cloudinit.util.load_file") + @mock.patch(M_PATH + "load_file")
+ def test_get_linux_msvsphere8_osrelease( + def test_get_linux_msvsphere8_osrelease(
+ self, m_os_release, m_path_exists + self, m_os_release, m_path_exists
+ ): + ):
@ -595,13 +598,12 @@ index 3765511..b1ee240 100644
+ m_os_release.return_value = OS_RELEASE_MSVSPHERE_8 + m_os_release.return_value = OS_RELEASE_MSVSPHERE_8
+ m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists + m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists
+ dist = util.get_linux_distro() + dist = util.get_linux_distro()
+ self.assertEqual(("msvsphere", "8.8", "Inferit"), dist) + self.assertEqual(("msvsphere", "8.9", "Inferit"), dist)
+
+ +
@mock.patch("cloudinit.util.load_file") @mock.patch(M_PATH + "load_file")
def test_get_linux_rocky8_rhrelease(self, m_os_release, m_path_exists): def test_get_linux_rocky8_rhrelease(self, m_os_release, m_path_exists):
"""Verify rocky linux 8 read from redhat-release.""" """Verify rocky linux 8 read from redhat-release."""
@@ -954,6 +998,7 @@ class TestGetVariant: @@ -1302,6 +1345,7 @@ class TestGetVariant:
({"system": "linux", "dist": ("ubuntu",)}, "ubuntu"), ({"system": "linux", "dist": ("ubuntu",)}, "ubuntu"),
({"system": "linux", "dist": ("linuxmint",)}, "ubuntu"), ({"system": "linux", "dist": ("linuxmint",)}, "ubuntu"),
({"system": "linux", "dist": ("mint",)}, "ubuntu"), ({"system": "linux", "dist": ("mint",)}, "ubuntu"),
@ -610,97 +612,107 @@ index 3765511..b1ee240 100644
({"system": "linux", "dist": ("opensuse",)}, "suse"), ({"system": "linux", "dist": ("opensuse",)}, "suse"),
({"system": "linux", "dist": ("opensuse-tumbleweed",)}, "suse"), ({"system": "linux", "dist": ("opensuse-tumbleweed",)}, "suse"),
diff --git a/tools/read-dependencies b/tools/read-dependencies diff --git a/tools/read-dependencies b/tools/read-dependencies
index 6ef72a9..686685f 100755 index d6a23c3..94a97d3 100755
--- a/tools/read-dependencies --- a/tools/read-dependencies
+++ b/tools/read-dependencies +++ b/tools/read-dependencies
@@ -25,6 +25,7 @@ DISTRO_PKG_TYPE_MAP = { @@ -26,6 +26,7 @@ DISTRO_PKG_TYPE_MAP = {
'centos': 'redhat', "centos": "redhat",
'eurolinux': 'redhat', "eurolinux": "redhat",
'miraclelinux': 'redhat', "miraclelinux": "redhat",
+ 'msvsphere': 'redhat', + 'msvsphere': 'redhat',
'rocky': 'redhat', "rocky": "redhat",
'redhat': 'redhat', "redhat": "redhat",
'debian': 'debian', "debian": "debian",
@@ -72,6 +73,7 @@ DRY_DISTRO_INSTALL_PKG_CMD = { @@ -81,10 +82,12 @@ ZYPPER_INSTALL = [
'centos': ['yum', 'install', '--assumeyes'], ]
'eurolinux': ['yum', 'install', '--assumeyes'],
'miraclelinux': ['yum', 'install', '--assumeyes'], DRYRUN_DISTRO_INSTALL_PKG_CMD = {
+ 'msvsphere': ['yum', 'install', '--assumeyes'], + "msvsphere": ["yum", "install", "--assumeyes"],
'redhat': ['yum', 'install', '--assumeyes'], "redhat": ["yum", "install", "--assumeyes"],
} }
@@ -79,6 +81,7 @@ DISTRO_INSTALL_PKG_CMD = { DISTRO_INSTALL_PKG_CMD = {
'rocky': MAYBE_RELIABLE_YUM_INSTALL,
'eurolinux': MAYBE_RELIABLE_YUM_INSTALL,
'miraclelinux': MAYBE_RELIABLE_YUM_INSTALL,
+ 'msvsphere': MAYBE_RELIABLE_YUM_INSTALL, + 'msvsphere': MAYBE_RELIABLE_YUM_INSTALL,
'centos': MAYBE_RELIABLE_YUM_INSTALL, "redhat": MAYBE_RELIABLE_YUM_INSTALL,
'redhat': MAYBE_RELIABLE_YUM_INSTALL, "debian": ["apt", "install", "-y"],
'debian': ['apt', 'install', '-y'], "suse": ZYPPER_INSTALL,
@@ -93,6 +96,7 @@ CI_SYSTEM_BASE_PKGS = { @@ -95,6 +98,7 @@ CI_SYSTEM_BASE_PKGS = {
'common': ['make', 'sudo', 'tar'], "common": ["make", "sudo", "tar"],
'eurolinux': ['python3-tox'], "eurolinux": ["python3-tox"],
'miraclelinux': ['python3-tox'], "miraclelinux": ["python3-tox"],
+ 'msvsphere': ['python3-tox'], + "msvsphere": ["python3-tox"],
'redhat': ['python3-tox'], "redhat": ["python3-tox"],
'centos': ['python3-tox'], "centos": ["python3-tox"],
'ubuntu': ['devscripts', 'python3-dev', 'libssl-dev', 'tox', 'sbuild'], "ubuntu": ["devscripts", "python3-dev", "libssl-dev", "tox", "sbuild"],
@@ -285,10 +289,10 @@ def pkg_install(pkg_list, distro, test_distro=False, dry_run=False): @@ -333,7 +337,7 @@ def pkg_install(pkg_list, distro, test_distro=False, dry_run=False):
cmd = DRY_DISTRO_INSTALL_PKG_CMD[distro] cmd = DISTRO_INSTALL_PKG_CMD[distro_family]
install_cmd.extend(cmd) install_cmd.extend(cmd)
- if distro in ['centos', 'redhat', 'rocky', 'eurolinux']: - if distro in ["centos", "redhat", "rocky", "eurolinux"]:
+ if distro in ['centos', 'redhat', 'rocky', 'eurolinux', 'msvsphere']: + if distro in ["centos", "redhat", "rocky", "eurolinux", "msvsphere"]:
# CentOS and Redhat need epel-release to access oauthlib and jsonschema # CentOS and Redhat need epel-release to access oauthlib and jsonschema
subprocess.check_call(install_cmd + ['epel-release']) subprocess.check_call(install_cmd + ["epel-release"])
- if distro in ['suse', 'opensuse', 'redhat', 'rocky', 'centos', 'eurolinux']: if distro in [
+ if distro in ['suse', 'opensuse', 'redhat', 'rocky', 'centos', 'eurolinux', 'msvsphere']: @@ -341,6 +345,7 @@ def pkg_install(pkg_list, distro, test_distro=False, dry_run=False):
pkg_list.append('rpm-build') "opensuse",
subprocess.check_call(install_cmd + pkg_list) "redhat",
"rocky",
+ "msvsphere",
"centos",
"eurolinux",
]:
diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg
index afe999e..c727370 100755 index 6551875..e2e9acd 100755
--- a/tools/render-cloudcfg --- a/tools/render-cloudcfg
+++ b/tools/render-cloudcfg +++ b/tools/render-cloudcfg
@@ -22,6 +22,7 @@ def main(): @@ -23,6 +23,7 @@ def main():
"freebsd",
"gentoo", "gentoo",
"mariner",
"miraclelinux", "miraclelinux",
+ "msvsphere", + "msvsphere",
"netbsd", "netbsd",
"openbsd", "openbsd",
"openEuler", "openEuler",
diff --git a/tools/run-container b/tools/run-container diff --git a/tools/run-container b/tools/run-container
index e049dfd..35b1e7e 100755 index 328ed93..59a8381 100755
--- a/tools/run-container --- a/tools/run-container
+++ b/tools/run-container +++ b/tools/run-container
@@ -247,7 +247,7 @@ apt_install() { @@ -192,7 +192,7 @@ os_info() {
get_os_info() {
# run inside container, set OS_NAME, OS_VERSION
- # example OS_NAME are centos, debian, opensuse, rockylinux
+ # example OS_NAME are centos, debian, msvsphere, opensuse, rockylinux
[ -n "${OS_NAME:-}" -a -n "${OS_VERSION:-}" ] && return 0
if [ -f /etc/os-release ]; then
OS_NAME=$(sh -c '. /etc/os-release; echo $ID')
@@ -248,7 +248,7 @@ apt_install() {
install_packages() { install_packages() {
get_os_info || return get_os_info || return
case "$OS_NAME" in case "$OS_NAME" in
- centos|rocky*) yum_install "$@";; - centos|rocky*) yum_install "$@";;
+ centos|msvsphere|rocky*) yum_install "$@";; + centos|msvsphere|rocky*) yum_install "$@";;
opensuse) zypper_install "$@";; opensuse*) zypper_install "$@";;
debian|ubuntu) apt_install "$@";; debian|ubuntu) apt_install "$@";;
*) error "Do not know how to install packages on ${OS_NAME}"; *) error "Do not know how to install packages on ${OS_NAME}";
@@ -486,7 +486,7 @@ main() { @@ -497,7 +497,7 @@ main() {
local build_pkg="" build_srcpkg="" pkg_ext="" distflag="" local build_pkg="" build_srcpkg="" pkg_ext="" distflag=""
case "$OS_NAME" in case "$OS_NAME" in
- centos|rocky) distflag="--distro=redhat";; - centos|rocky*) distflag="--distro=redhat";;
+ centos|msvsphere|rocky) distflag="--distro=redhat";; + centos|msvsphere|rocky*) distflag="--distro=redhat";;
opensuse) distflag="--distro=suse";; opensuse*) distflag="--distro=suse";;
esac esac
@@ -495,7 +495,7 @@ main() { @@ -506,7 +506,7 @@ main() {
build_pkg="./packages/bddeb -d" build_pkg="./packages/bddeb -d"
build_srcpkg="./packages/bddeb -S -d" build_srcpkg="./packages/bddeb -S -d"
pkg_ext=".deb";; pkg_ext=".deb";;
- centos|opensuse|rocky) - centos|opensuse*|rocky*)
+ centos|opensuse|msvsphere|rocky) + centos|opensuse*|msvsphere|rocky*)
build_pkg="./packages/brpm $distflag" build_pkg="./packages/brpm $distflag"
build_srcpkg="./packages/brpm $distflag --srpm" build_srcpkg="./packages/brpm $distflag --srpm"
pkg_ext=".rpm";; pkg_ext=".rpm";;
-- --
2.39.2 2.43.0

Loading…
Cancel
Save