From cd1d5037e03638068e703c36b2536f8adf89915b Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Mon, 20 Sep 2021 10:49:45 +0300 Subject: [PATCH] Add debian package for puppet-module-openstacklib-17.4.0 Aligned with Debian Bullseye version puppet-module-openstacklib-17.4.0-2. Did build puppet-openstacklib-17.4.0 + starlingx patches (adapted from CentOS7). Adapted all patches. Adapt patch 0001. Drop patch 0002, as it is merged upstream. Did build an iso. Story: 2009101 Task: 43366 Signed-off-by: Dan Voiculeasa Change-Id: I2b85edb0ec0712b32709b3368a6924f6c707615b --- .../debian/meta_data.yaml | 10 +++ ...01-Adapt-first-set-of-legacy-patches.patch | 88 +++++++++++++++++++ .../debian/patches/series | 1 + 3 files changed, 99 insertions(+) create mode 100644 config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/meta_data.yaml create mode 100644 config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0001-Adapt-first-set-of-legacy-patches.patch create mode 100644 config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series diff --git a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/meta_data.yaml b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/meta_data.yaml new file mode 100644 index 000000000..11834b805 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/meta_data.yaml @@ -0,0 +1,10 @@ +--- +debname: puppet-module-openstacklib +debver: 17.4.0-2 +dl_path: + name: puppet-module-openstacklib-17.4.0-2.tar.gz + url: https://salsa.debian.org/openstack-team/puppet/puppet-module-openstacklib/-/archive/debian/17.4.0-2/puppet-module-openstacklib-debian-17.4.0-2.tar.gz + md5sum: b7509751fe173ba20555859186fae36b +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0001-Adapt-first-set-of-legacy-patches.patch b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0001-Adapt-first-set-of-legacy-patches.patch new file mode 100644 index 000000000..7f44be8d3 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/0001-Adapt-first-set-of-legacy-patches.patch @@ -0,0 +1,88 @@ +From 76473fecb52b01f122c50dba751732dfa7da2948 Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Mon, 20 Sep 2021 12:05:10 +0300 +Subject: [PATCH] Adapt first set of legacy patches + +Adapt 0001-Roll-up-TIS-patches.patch from CentOS. + +Signed-off-by: Dan Voiculeasa +--- + lib/puppet/provider/openstack.rb | 1 + + lib/puppet/provider/openstack/auth.rb | 16 ++++++++++++++-- + lib/puppet/provider/openstack/credentials.rb | 2 -- + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/lib/puppet/provider/openstack.rb b/lib/puppet/provider/openstack.rb +index 3d80d68..280315c 100644 +--- a/lib/puppet/provider/openstack.rb ++++ b/lib/puppet/provider/openstack.rb +@@ -45,6 +45,7 @@ class Puppet::Provider::Openstack < Puppet::Provider + begin + action = args[1] + Timeout.timeout(command_timeout(action)) do ++ args.unshift('--os-interface', 'internal') + execute([command(:openstack_command)] + args, override_locale: false, failonfail: true, combine: true) + end + rescue Timeout::Error +diff --git a/lib/puppet/provider/openstack/auth.rb b/lib/puppet/provider/openstack/auth.rb +index 743071d..4026aec 100644 +--- a/lib/puppet/provider/openstack/auth.rb ++++ b/lib/puppet/provider/openstack/auth.rb +@@ -1,9 +1,19 @@ + #require 'puppet/provider/openstack/credentials' + require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/openstack/credentials') ++require 'hiera_puppet' + + module Puppet::Provider::Openstack::Auth + +- RCFILENAME = "#{ENV['HOME']}/openrc" ++ RCFILENAME = "/etc/platform/openrc" ++ ++ def lookup_hiera(key) ++ HieraPuppet.lookup(key, :undef, self, nil, :priority) ++ end ++ ++ def get_admin_password ++ value=lookup_hiera('keystone::admin_password') ++ return value ++ end + + def get_os_vars_from_env + env = {} +@@ -17,7 +27,7 @@ module Puppet::Provider::Openstack::Auth + unless rcfile.nil? + File.open(rcfile).readlines.delete_if{|l| l=~ /^#|^$/ }.each do |line| + # we only care about the OS_ vars from the file LP#1699950 +- if line =~ /OS_/ ++ if line =~ /OS_/ and line.include?('=') + key, value = line.split('=') + key = key.split(' ').last + value = value.chomp.gsub(/'/, '') +@@ -38,6 +48,8 @@ module Puppet::Provider::Openstack::Auth + unless @credentials.set? + @credentials.unset + set_credentials(@credentials, get_os_vars_from_rcfile(rc_filename)) ++ # retrieves the password from hiera data since keyring is not yet available ++ @credentials.password = get_admin_password + end + unless @credentials.set? + raise(Puppet::Error::OpenstackAuthInputError, 'Insufficient credentials to authenticate') +diff --git a/lib/puppet/provider/openstack/credentials.rb b/lib/puppet/provider/openstack/credentials.rb +index afade9c..8f0c953 100644 +--- a/lib/puppet/provider/openstack/credentials.rb ++++ b/lib/puppet/provider/openstack/credentials.rb +@@ -67,11 +67,9 @@ class Puppet::Provider::Openstack::CredentialsV3 < Puppet::Provider::Openstack:: + :domain_id, + :domain_name, + :key, +- :project_domain_id, + :project_domain_name, + :project_id, + :trust_id, +- :user_domain_id, + :user_domain_name, + :user_id + ] +-- +2.30.0 + diff --git a/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series new file mode 100644 index 000000000..563d1ae6a --- /dev/null +++ b/config/puppet-modules/openstack/puppet-openstacklib-17.4.0/debian/patches/series @@ -0,0 +1 @@ +0001-Adapt-first-set-of-legacy-patches.patch