stx-puppet: update for stx 5.0

* update the branch and srcrev for stx 5.0
* update the PV with adding git${SRCPV}
* rebased several patches and renamed in order
* add dependency on python-ruamel.yaml
* fix the hardcoded binary paths

Story: 2008952
Task: 42576

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: Ic24bb4aa626fe84259442170392ab52afd782258
This commit is contained in:
Jackie Huang 2021-05-27 14:59:46 +08:00
parent 6a08dca8fb
commit 4538d7841a
10 changed files with 184 additions and 83 deletions

View File

@ -1,5 +1,19 @@
From 6abfdb9bcac3772142efcc7ee399d1224b031622 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 27 May 2021 15:14:55 +0800
Subject: [PATCH 03/12] puppet-dcmanager-updates-for-poky-stx
Upstream-Status: Inappropriate [poky-stx specific]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../src/dcmanager/manifests/params.pp | 29 ++++++++++++++++------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/modules/puppet-dcmanager/src/dcmanager/manifests/params.pp b/modules/puppet-dcmanager/src/dcmanager/manifests/params.pp
index 5cbfb50..0a4d91b 100644
index 5cbfb50..b932048 100644
--- a/modules/puppet-dcmanager/src/dcmanager/manifests/params.pp
+++ b/modules/puppet-dcmanager/src/dcmanager/manifests/params.pp
@@ -13,13 +13,28 @@ class dcmanager::params {
@ -38,3 +52,6 @@ index 5cbfb50..0a4d91b 100644
} elsif($::osfamily == 'RedHat') {
--
2.7.4

View File

@ -1,8 +1,22 @@
From dea274faeadd858924bc1124dec9b574975560ef Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 27 May 2021 15:26:01 +0800
Subject: [PATCH 04/12] puppet-dcorch-updates-for-poky-stx
Upstream-Status: Inappropriate [poky-stx specific]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../puppet-dcorch/src/dcorch/manifests/params.pp | 34 ++++++++++++++++------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/modules/puppet-dcorch/src/dcorch/manifests/params.pp b/modules/puppet-dcorch/src/dcorch/manifests/params.pp
index 76d5fa1..334cfeb 100644
index df823dc..c4b727a 100644
--- a/modules/puppet-dcorch/src/dcorch/manifests/params.pp
+++ b/modules/puppet-dcorch/src/dcorch/manifests/params.pp
@@ -14,18 +14,37 @@ class dcorch::params {
@@ -14,16 +14,32 @@ class dcorch::params {
$dcorch_paste_api_ini = '/etc/dcorch/api-paste.ini'
if $::osfamily == 'Debian' {
@ -12,20 +26,15 @@ index 76d5fa1..334cfeb 100644
- $api_service = 'dcorch-api'
- $engine_package = 'distributedcloud-dcorch'
- $engine_service = 'dcorch-engine'
- $snmp_package = 'distributedcloud-dcorch'
- $snmp_service = 'dcorch-snmp'
- $api_proxy_package = 'distributedcloud-dcorch'
- $api_proxy_service = 'dcorch-api-proxy'
+ if $::operatingsystem == 'poky-stx' {
- $db_sync_command = 'dcorch-manage db_sync'
+ if $::operatingsystem == 'poky-stx' {
+
+ $package_name = 'dcorch'
+ $client_package = 'distributedcloud-client-dcorchclient'
+ $api_package = false
+ $api_service = 'dcorch-api'
+ $snmp_package = false
+ $snmp_service = 'dcorch-snmp'
+ $engine_package = false
+ $engine_service = 'dcorch-engine'
+ $api_proxy_package = false
@ -40,8 +49,6 @@ index 76d5fa1..334cfeb 100644
+ $api_service = 'dcorch-api'
+ $engine_package = 'distributedcloud-dcorch'
+ $engine_service = 'dcorch-engine'
+ $snmp_package = 'distributedcloud-dcorch'
+ $snmp_service = 'dcorch-snmp'
+ $api_proxy_package = 'distributedcloud-dcorch'
+ $api_proxy_service = 'dcorch-api-proxy'
+
@ -51,3 +58,6 @@ index 76d5fa1..334cfeb 100644
} elsif($::osfamily == 'RedHat') {
--
2.7.4

View File

@ -1,8 +1,22 @@
From 3d5b0acaf62845c69861df43f6d9584b68608096 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 27 May 2021 15:33:36 +0800
Subject: [PATCH 05/12] puppet-sysinv-updates-for-poky-stx
Upstream-Status: Inappropriate [poky-stx specific]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../puppet-sysinv/src/sysinv/manifests/params.pp | 37 ++++++++++++++++------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/modules/puppet-sysinv/src/sysinv/manifests/params.pp b/modules/puppet-sysinv/src/sysinv/manifests/params.pp
index 438aa37..9fc72e9 100644
index 285220d..d401f23 100644
--- a/modules/puppet-sysinv/src/sysinv/manifests/params.pp
+++ b/modules/puppet-sysinv/src/sysinv/manifests/params.pp
@@ -21,15 +21,30 @@ class sysinv::params {
@@ -22,16 +22,33 @@ class sysinv::params {
$sysinv_paste_api_ini = '/etc/sysinv/api-paste.ini'
if $::osfamily == 'Debian' {
@ -14,6 +28,7 @@ index 438aa37..9fc72e9 100644
- $conductor_service = 'sysinv-conductor'
- $agent_package = 'sysinv'
- $agent_service = 'sysinv-agent'
- $certmon_package = 'cert-mon'
- $db_sync_command = 'sysinv-dbsync'
+ if $::operatingsystem == 'poky-stx' {
+
@ -25,6 +40,7 @@ index 438aa37..9fc72e9 100644
+ $conductor_service = 'sysinv-conductor'
+ $agent_package = 'sysinv-agent'
+ $agent_service = 'sysinv-agent'
+ $certmon_package = 'cert-mon'
+ $db_sync_command = 'sysinv-dbsync'
+
+ } else {
@ -37,8 +53,13 @@ index 438aa37..9fc72e9 100644
+ $conductor_service = 'sysinv-conductor'
+ $agent_package = 'sysinv'
+ $agent_service = 'sysinv-agent'
+ $certmon_package = 'cert-mon'
+ $db_sync_command = 'sysinv-dbsync'
+
+ }
} elsif($::osfamily == 'RedHat') {
--
2.7.4

View File

@ -1,25 +0,0 @@
From 804d05b0e188b8e694def2abcd0d9b0979b40b6f Mon Sep 17 00:00:00 2001
From: "Sar Ashki, Babak" <Babak.SarAshki@windriver.com>
Date: Tue, 7 Jan 2020 16:08:24 -0800
Subject: [PATCH] puppet-manifests:etcd-override typo and journalctl
---
.../src/modules/platform/files/etcd-override.conf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/puppet-manifests/src/modules/platform/files/etcd-override.conf b/puppet-manifests/src/modules/platform/files/etcd-override.conf
index 09d2ed47..5860aab4 100644
--- a/puppet-manifests/src/modules/platform/files/etcd-override.conf
+++ b/puppet-manifests/src/modules/platform/files/etcd-override.conf
@@ -4,6 +4,6 @@ User=root
NotifyAccess=all
Type=notify
ExecStart=
-ExecStart=-/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\" 2>&1 | /usr/bin/forward-journald -tag etcd"
+ExecStart=-/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\" 2>&1"
ExecStartPost=/bin/bash -c 'echo $MAINPID >/var/run/etcd.pid'
-ExecStopPost=/bin/bash/rm -f /var/run/etcd.pid
+ExecStopPost=/bin/bash -c 'rm -f /var/run/etcd.pid'
--
2.23.0

View File

@ -1,3 +1,17 @@
From 5e41d09743780d9bdb96adfa7d15ef7b5480c7fb Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 27 May 2021 15:44:26 +0800
Subject: [PATCH 07/12] get-boot-device-from-cmdline
Upstream-Status: Inappropriate [poky-stx specific]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
.../src/modules/platform/lib/facter/is_primary_disk_rotational.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/puppet-manifests/src/modules/platform/lib/facter/is_primary_disk_rotational.rb b/puppet-manifests/src/modules/platform/lib/facter/is_primary_disk_rotational.rb
index d80896f..599fcd8 100644
--- a/puppet-manifests/src/modules/platform/lib/facter/is_primary_disk_rotational.rb
@ -10,3 +24,6 @@ index d80896f..599fcd8 100644
rootfs_device = Facter::Core::Execution.exec("basename #{rootfs_partition} | sed 's/[0-9]*$//;s/p[0-9]*$//'")
setcode "cat /sys/block/#{rootfs_device}/queue/rotational"
end
--
2.7.4

View File

@ -1,43 +1,48 @@
From 3d8cce4420f84bac979e9b10384fddb4d7c810d9 Mon Sep 17 00:00:00 2001
From d25e6c87cd0d1c33206018d94d62aa487fc790c8 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Wed, 18 Nov 2020 09:45:54 +0800
Subject: [PATCH] kubernetes.pp: add re-tries for docker login
Date: Thu, 27 May 2021 15:42:48 +0800
Subject: [PATCH 10/12] kubernetes.pp: add re-tries for docker login
The docker login to local registry may sometimes fail:
Error: docker login registry.local:9001 -u admin -p St8rlingX* returned 1 instead of one of [0]
Error: docker login registry.local:9001 -u admin -p St8rlingX* returned
1 instead of one of [0]
It's rare and the root cause is not found yet, but a re-try will always succeed,
so add re-tries and a try sleep between re-tries to workaround it for now.
It's rare and the root cause is not found yet, but a re-try will always
succeed,
so add re-tries and a try sleep between re-tries to workaround it for
now.
Upstream-Status: Inappropriate [workaround]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
puppet-manifests/src/modules/platform/manifests/kubernetes.pp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
index 3fa1c8a..af69373 100644
index e7e9c51..235618c 100644
--- a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
+++ b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
@@ -269,6 +269,8 @@ class platform::kubernetes::master::init
-> exec { 'login local registry':
command => "docker login registry.local:9001 -u ${::platform::dockerdistribution::params::registry_username} -p ${::platform::dockerdistribution::params::registry_password}", # lint:ignore:140chars
@@ -279,6 +279,8 @@ class platform::kubernetes::master::init
-> exec { 'remove taint from master node':
command => "kubectl --kubeconfig=/etc/kubernetes/admin.conf taint node ${::platform::params::hostname} node-role.kubernetes.io/master- || true", # lint:ignore:140chars
logoutput => true,
+ tries => 3,
+ try_sleep => 1,
}
-> exec { 'kubeadm to pre pull images':
@@ -384,6 +386,8 @@ class platform::kubernetes::worker::init
exec { 'login local registry':
command => "docker login registry.local:9001 -u ${::platform::dockerdistribution::params::registry_username} -p ${::platform::dockerdistribution::params::registry_password}", # lint:ignore:140chars
# Add kubelet service override
@@ -497,6 +499,8 @@ class platform::kubernetes::coredns {
exec { 'restrict coredns to master nodes':
command => 'kubectl --kubeconfig=/etc/kubernetes/admin.conf -n kube-system patch deployment coredns -p \'{"spec":{"template":{"spec":{"nodeSelector":{"node-role.kubernetes.io/master":""}}}}}\'', # lint:ignore:140chars
logoutput => true,
+ tries => 3,
+ try_sleep => 1,
}
-> exec { 'load k8s pause image':
--
-> exec { 'Use anti-affinity for coredns pods':
--
2.7.4

View File

@ -0,0 +1,38 @@
From 508a36111877c72d6c6e13f94dbbce1b7627774f Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 27 May 2021 15:46:55 +0800
Subject: [PATCH 12/12] poky-specific-apply-network-config-script
Upstream-Status: Inappropriate [poky-stx specific]
Rebased for stx 5.0
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
puppet-manifests/src/modules/platform/manifests/network.pp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/puppet-manifests/src/modules/platform/manifests/network.pp b/puppet-manifests/src/modules/platform/manifests/network.pp
index fea1abc..f94c2f2 100644
--- a/puppet-manifests/src/modules/platform/manifests/network.pp
+++ b/puppet-manifests/src/modules/platform/manifests/network.pp
@@ -315,8 +315,14 @@ class platform::network::apply {
-> Network_route6 <| |>
-> Exec['apply-network-config']
- exec {'apply-network-config':
- command => 'apply_network_config.sh',
+ if($::operatingsystem == 'poky-stx') {
+ exec {'apply-network-config':
+ command => 'apply_network_config_poky.sh',
+ }
+ } else {
+ exec {'apply-network-config':
+ command => 'apply_network_config.sh',
+ }
}
# Wait for network interface to leave tentative state during ipv6 DAD
exec {'wait-for-tentative':
--
2.7.4

View File

@ -0,0 +1,26 @@
From b3a7a5b0aa1541e1f8d52121b83ed8cc8e4bc5c2 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Fri, 9 Jul 2021 16:48:36 +0800
Subject: [PATCH] containerd.pp: adjust the package name for poky-stx
Upstream-Status: Inappropriate [poky-stx specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
puppet-manifests/src/modules/platform/manifests/containerd.pp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/puppet-manifests/src/modules/platform/manifests/containerd.pp b/puppet-manifests/src/modules/platform/manifests/containerd.pp
index b3b0504..c2ca9c4 100644
--- a/puppet-manifests/src/modules/platform/manifests/containerd.pp
+++ b/puppet-manifests/src/modules/platform/manifests/containerd.pp
@@ -1,5 +1,5 @@
class platform::containerd::params (
- $package_name = 'containerd',
+ $package_name = 'containerd-opencontainers',
$http_proxy = undef,
$https_proxy = undef,
$no_proxy = undef,
--
2.7.4

View File

@ -1,20 +0,0 @@
diff -ru a/puppet-manifests/src/modules/platform/manifests/network.pp b/puppet-manifests/src/modules/platform/manifests/network.pp
--- a/puppet-manifests/src/modules/platform/manifests/network.pp 2020-04-08 19:10:04.478548420 +0800
+++ b/puppet-manifests/src/modules/platform/manifests/network.pp 2020-04-08 19:10:22.674548916 +0800
@@ -208,8 +208,14 @@
-> Network_route6 <| |>
-> Exec['apply-network-config']
- exec {'apply-network-config':
- command => 'apply_network_config.sh',
+ if($::operatingsystem == 'poky-stx') {
+ exec {'apply-network-config':
+ command => 'apply_network_config_poky.sh',
+ }
+ } else {
+ exec {'apply-network-config':
+ command => 'apply_network_config.sh',
+ }
}
}

View File

@ -4,10 +4,10 @@ DESCRIPTION = "stx-puppet modules"
STABLE = "starlingx/master"
PROTOCOL = "https"
SRCNAME = "stx-puppet"
BRANCH = "r/stx.3.0"
SRCREV = "678fe78b72b70e213eae32b1932afe97cc8c16b4"
BRANCH = "r/stx.5.0"
SRCREV = "fddac0bf3cc16be78743961f0b9379a48605707a"
S = "${WORKDIR}/git"
PV = "1.0.0"
PV = "1.0.0+git${SRCPV}"
LICENSE = "Apache-2.0"
@ -25,7 +25,6 @@ LIC_FILES_CHKSUM = " \
file://puppet-manifests/src/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
"
# file://${BPN}/use-cast-operator.patch
SRC_URI = " \
git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH} \
file://${BPN}/0001-puppet-manifest-apply-rebase-adjust-path.patch \
@ -34,13 +33,14 @@ SRC_URI = " \
file://${BPN}/0004-puppet-dcorch-updates-for-poky-stx.patch \
file://${BPN}/0005-puppet-sysinv-updates-for-poky-stx.patch \
file://${BPN}/0006-puppet-manifest-apply-do-not-treat-warnings-as-block.patch \
file://${BPN}/0007-puppet-manifests-etcd-override-typo-and-journalctl.patch \
file://${BPN}/0007-puppet-manifests-get-boot-device-from-cmdline.patch \
file://${BPN}/0008-puppet-manifests-keystone-include-platform-client.patch \
file://${BPN}/0009-puppet-manifests-lvm-remove-lvmetad.patch \
file://${BPN}/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch \
file://${BPN}/0011-puppet-manifest-kubernetes.pp-add-re-tries-for-docker-login.patch \
file://${BPN}/get-boot-device-from-cmdline.patch \
file://${BPN}/poky-specific-apply-network-config-script.patch \
file://${BPN}/0012-puppet-manifests-poky-specific-apply-network-config-script.patch \
file://${BPN}/0013-puppet-manifest-adjust-the-containerd-package-name.patch \
\
file://${BPN}/apply_network_config_poky.sh \
"
@ -52,6 +52,7 @@ RDEPENDS_${PN} += " \
multipath-tools \
multipath-tools-libs \
ntpdate \
python-ruamel.yaml \
puppet-staging \
puppet-oslo \
puppetlabs-apache \
@ -189,6 +190,17 @@ do_install() {
# fix the libdir for collectd
sed -i -e 's|/usr/lib64|${libdir}|' ${D}/${datadir}/puppet/modules/platform/templates/collectd.conf.erb
sed -i -e 's|/usr/local/bin|${bindir}|' \
-e 's|/usr/local/sbin|${sbindir}|' \
${D}/${datadir}/puppet/modules/openstack/manifests/keystone.pp \
${D}/${datadir}/puppet/modules/openstack/templates/lighttpd.conf.erb \
${D}/${datadir}/puppet/modules/platform/manifests/grub.pp \
${D}/${datadir}/puppet/modules/platform/manifests/ceph.pp \
${D}/${datadir}/puppet/modules/platform/manifests/docker.pp \
${D}/${datadir}/puppet/modules/platform/manifests/kubernetes.pp \
${D}/${datadir}/puppet/modules/platform/manifests/compute.pp \
install -m 0755 ${WORKDIR}/${PN}/apply_network_config_poky.sh ${D}/${bindir}/apply_network_config_poky.sh
}