From d2b34d006bf91a2224b855841ed9d0adb580496c Mon Sep 17 00:00:00 2001
From: Alfredo Moralejo <amoralej@redhat.com>
Date: Wed, 26 Feb 2020 09:53:23 +0100
Subject: [PATCH] Move CentOS8 to standard Puppetfile and bump puppet-mysql

mariadb has been updated in RDO CentOS7 for Ussuri so we can bump
puppet-mysql and use the same Puppetfile for all cases, no more
exceptions for CentOS8 are needed.

Change-Id: I1c4204c5b9fb893a2209666894792938f72b7548
---
 Puppetfile           |   2 +-
 Puppetfile_centos8   | 252 -------------------------------------------
 external_modules.txt |   2 +-
 functions            |  11 +-
 4 files changed, 5 insertions(+), 262 deletions(-)
 delete mode 100644 Puppetfile_centos8

diff --git a/Puppetfile b/Puppetfile
index afafaa713..139abf221 100644
--- a/Puppetfile
+++ b/Puppetfile
@@ -196,7 +196,7 @@ mod 'inifile',
 
 mod 'mysql',
   :git => 'https://github.com/puppetlabs/puppetlabs-mysql',
-  :ref => '6.2.0'
+  :ref => 'v10.3.0'
 
 mod 'postgresql',
   :git => 'https://github.com/puppetlabs/puppetlabs-postgresql',
diff --git a/Puppetfile_centos8 b/Puppetfile_centos8
deleted file mode 100644
index d5a1be51a..000000000
--- a/Puppetfile_centos8
+++ /dev/null
@@ -1,252 +0,0 @@
-# Auto-generated Puppetfile for Puppet OpenStack project
-
-## OpenStack modules
-mod 'aodh',
-  :git => 'https://opendev.org/openstack/puppet-aodh',
-  :ref => 'master'
-
-mod 'barbican',
-  :git => 'https://opendev.org/openstack/puppet-barbican',
-  :ref => 'master'
-
-mod 'ceilometer',
-  :git => 'https://opendev.org/openstack/puppet-ceilometer',
-  :ref => 'master'
-
-mod 'ceph',
-  :git => 'https://opendev.org/openstack/puppet-ceph',
-  :ref => 'master'
-
-mod 'cinder',
-  :git => 'https://opendev.org/openstack/puppet-cinder',
-  :ref => 'master'
-
-mod 'cloudkitty',
-  :git => 'https://opendev.org/openstack/puppet-cloudkitty',
-  :ref => 'master'
-
-mod 'congress',
-  :git => 'https://opendev.org/openstack/puppet-congress',
-  :ref => 'master'
-
-mod 'designate',
-  :git => 'https://opendev.org/openstack/puppet-designate',
-  :ref => 'master'
-
-mod 'ec2api',
-  :git => 'https://opendev.org/openstack/puppet-ec2api',
-  :ref => 'master'
-
-mod 'glance',
-  :git => 'https://opendev.org/openstack/puppet-glance',
-  :ref => 'master'
-
-mod 'gnocchi',
-  :git => 'https://opendev.org/openstack/puppet-gnocchi',
-  :ref => 'master'
-
-mod 'heat',
-  :git => 'https://opendev.org/openstack/puppet-heat',
-  :ref => 'master'
-
-mod 'horizon',
-  :git => 'https://opendev.org/openstack/puppet-horizon',
-  :ref => 'master'
-
-mod 'ironic',
-  :git => 'https://opendev.org/openstack/puppet-ironic',
-  :ref => 'master'
-
-mod 'keystone',
-  :git => 'https://opendev.org/openstack/puppet-keystone',
-  :ref => 'master'
-
-mod 'manila',
-  :git => 'https://opendev.org/openstack/puppet-manila',
-  :ref => 'master'
-
-mod 'mistral',
-  :git => 'https://opendev.org/openstack/puppet-mistral',
-  :ref => 'master'
-
-mod 'monasca',
-  :git => 'https://opendev.org/openstack/puppet-monasca',
-  :ref => 'master'
-
-mod 'murano',
-  :git => 'https://opendev.org/openstack/puppet-murano',
-  :ref => 'master'
-
-mod 'neutron',
-  :git => 'https://opendev.org/openstack/puppet-neutron',
-  :ref => 'master'
-
-mod 'nova',
-  :git => 'https://opendev.org/openstack/puppet-nova',
-  :ref => 'master'
-
-mod 'octavia',
-  :git => 'https://opendev.org/openstack/puppet-octavia',
-  :ref => 'master'
-
-mod 'openstack_extras',
-  :git => 'https://opendev.org/openstack/puppet-openstack_extras',
-  :ref => 'master'
-
-mod 'openstacklib',
-  :git => 'https://opendev.org/openstack/puppet-openstacklib',
-  :ref => 'master'
-
-mod 'oslo',
-  :git => 'https://opendev.org/openstack/puppet-oslo',
-  :ref => 'master'
-
-mod 'ovn',
-  :git => 'https://opendev.org/openstack/puppet-ovn',
-  :ref => 'master'
-
-mod 'panko',
-  :git => 'https://opendev.org/openstack/puppet-panko',
-  :ref => 'master'
-
-mod 'placement',
-  :git => 'https://opendev.org/openstack/puppet-placement',
-  :ref => 'master'
-
-mod 'qdr',
-  :git => 'https://opendev.org/openstack/puppet-qdr',
-  :ref => 'master'
-
-mod 'sahara',
-  :git => 'https://opendev.org/openstack/puppet-sahara',
-  :ref => 'master'
-
-mod 'swift',
-  :git => 'https://opendev.org/openstack/puppet-swift',
-  :ref => 'master'
-
-mod 'tacker',
-  :git => 'https://opendev.org/openstack/puppet-tacker',
-  :ref => 'master'
-
-mod 'tempest',
-  :git => 'https://opendev.org/openstack/puppet-tempest',
-  :ref => 'master'
-
-mod 'trove',
-  :git => 'https://opendev.org/openstack/puppet-trove',
-  :ref => 'master'
-
-mod 'vswitch',
-  :git => 'https://opendev.org/openstack/puppet-vswitch',
-  :ref => 'master'
-
-mod 'vitrage',
-  :git => 'https://opendev.org/openstack/puppet-vitrage',
-  :ref => 'master'
-
-mod 'watcher',
-  :git => 'https://opendev.org/openstack/puppet-watcher',
-  :ref => 'master'
-
-mod 'zaqar',
-  :git => 'https://opendev.org/openstack/puppet-zaqar',
-  :ref => 'master'
-
-## External modules
-mod 'powerdns',
-  :git => 'https://github.com/antonlindstrom/puppet-powerdns',
-  :ref => '0.0.5'
-
-mod 'kmod',
-  :git => 'https://github.com/camptocamp/puppet-kmod',
-  :ref => '2.3.1'
-
-mod 'sysctl',
-  :git => 'https://github.com/duritong/puppet-sysctl',
-  :ref => 'v0.0.12'
-
-mod 'ipaclient',
-  :git => 'https://github.com/joshuabaird/puppet-ipaclient',
-  :ref => '2.5.2'
-
-mod 'staging',
-  :git => 'https://github.com/nanliu/puppet-staging',
-  :ref => '1.0.4'
-
-mod 'apache',
-  :git => 'https://github.com/puppetlabs/puppetlabs-apache',
-  :ref => 'v5.3.0'
-
-mod 'apt',
-  :git => 'https://github.com/puppetlabs/puppetlabs-apt',
-  :ref => '2.4.0'
-
-mod 'concat',
-  :git => 'https://github.com/puppetlabs/puppetlabs-concat',
-  :ref => '2.2.1'
-
-mod 'firewall',
-  :git => 'https://github.com/puppetlabs/puppetlabs-firewall',
-  :ref => 'v2.2.0'
-
-mod 'inifile',
-  :git => 'https://github.com/puppetlabs/puppetlabs-inifile',
-  :ref => '2.2.0'
-
-mod 'mysql',
-  :git => 'https://github.com/puppetlabs/puppetlabs-mysql',
-  :ref => 'v10.3.0'
-
-mod 'postgresql',
-  :git => 'https://github.com/puppetlabs/puppetlabs-postgresql',
-  :ref => 'v6.2.0'
-
-mod 'rabbitmq',
-  :git => 'https://github.com/voxpupuli/puppet-rabbitmq',
-  :ref => 'v10.0.0'
-
-mod 'rsync',
-  :git => 'https://github.com/puppetlabs/puppetlabs-rsync',
-  :ref => '1.1.1'
-
-mod 'stdlib',
-  :git => 'https://github.com/puppetlabs/puppetlabs-stdlib',
-  :ref => 'v6.2.0'
-
-mod 'vcsrepo',
-  :git => 'https://github.com/puppetlabs/puppetlabs-vcsrepo',
-  :ref => 'v3.1.0'
-
-mod 'git_resource',
-  :git => 'https://github.com/voxpupuli/puppet-git_resource',
-  :ref => 'v1.0.2'
-
-mod 'xinetd',
-  :git => 'https://github.com/puppetlabs/puppetlabs-xinetd',
-  :ref => 'v3.3.0'
-
-mod 'memcached',
-  :git => 'https://github.com/saz/puppet-memcached',
-  :ref => 'v3.4.0'
-
-mod 'python',
-  :git => 'https://github.com/voxpupuli/puppet-python',
-  :ref => 'v4.0.0'
-
-mod 'dns',
-  :git => 'https://github.com/theforeman/puppet-dns',
-  :ref => '6.2.0'
-
-mod 'archive',
-  :git => 'https://github.com/voxpupuli/puppet-archive',
-  :ref => 'v4.4.0'
-
-mod 'corosync',
-  :git => 'https://github.com/voxpupuli/puppet-corosync',
-  :ref => 'v5.0.0'
-
-mod 'ssh_keygen',
-  :git => 'https://github.com/voxpupuli/puppet-ssh_keygen',
-  :ref => 'v2.0.1'
-
diff --git a/external_modules.txt b/external_modules.txt
index 414760065..10638f584 100644
--- a/external_modules.txt
+++ b/external_modules.txt
@@ -8,7 +8,7 @@ puppetlabs/puppetlabs-apt,2.4.0
 puppetlabs/puppetlabs-concat,2.2.1
 puppetlabs/puppetlabs-firewall
 puppetlabs/puppetlabs-inifile,2.2.0
-puppetlabs/puppetlabs-mysql,6.2.0
+puppetlabs/puppetlabs-mysql
 puppetlabs/puppetlabs-postgresql
 voxpupuli/puppet-rabbitmq
 puppetlabs/puppetlabs-rsync
diff --git a/functions b/functions
index 31a05bad3..efbf9cebf 100644
--- a/functions
+++ b/functions
@@ -8,11 +8,6 @@
 #
 # - ``SCRIPT_DIR`` must be set to script path
 # - ``GEM_BIN_DIR`` must be set to Gem bin directory
-BASE_PUPPETFILE=Puppetfile
-source /etc/os-release
-if [[ "${REDHAT_SUPPORT_PRODUCT,,}" = "centos" && ${REDHAT_SUPPORT_PRODUCT_VERSION} = "8" ]]; then
-    BASE_PUPPETFILE=Puppetfile_centos8
-fi
 install_external() {
   PUPPETFILE=${SCRIPT_DIR}/Puppetfile1 r10k -v DEBUG puppetfile install
 }
@@ -63,7 +58,7 @@ install_openstack() {
 install_all() {
   # When installing from local source, we want to install the current source
   # we're working from.
-  PUPPETFILE=${SCRIPT_DIR}/${BASE_PUPPETFILE} r10k -v DEBUG puppetfile install
+  PUPPETFILE=${SCRIPT_DIR}/Puppetfile r10k -v DEBUG puppetfile install
   cp -a ${SCRIPT_DIR} ${PUPPETFILE_DIR}/openstack_integration
 }
 
@@ -76,7 +71,7 @@ install_all() {
 # - ``ZUUL_BRANCH`` must be set to Zuul branch
 install_modules() {
   if [ -d /home/zuul/src/opendev.org ] ; then
-    csplit ${SCRIPT_DIR}/${BASE_PUPPETFILE} /'External modules'/ \
+    csplit ${SCRIPT_DIR}/Puppetfile /'External modules'/ \
       --prefix ${SCRIPT_DIR}/Puppetfile \
       --suffix '%d'
     install_external
@@ -95,7 +90,7 @@ install_modules() {
 # - ``ZUUL_BRANCH`` must be set to Zuul branch
 install_modules_unit() {
   if [ -d /home/zuul/src/opendev.org ] ; then
-    csplit ${SCRIPT_DIR}/${BASE_PUPPETFILE} /'External modules'/ \
+    csplit ${SCRIPT_DIR}/Puppetfile /'External modules'/ \
       --prefix ${SCRIPT_DIR}/Puppetfile \
       --suffix '%d'
     cat ${SCRIPT_DIR}/Puppetfile_unit >> ${SCRIPT_DIR}/Puppetfile1