Skip to content

Commit 19cd4d7

Browse files
markllamajprovaznik
authored andcommitted
Allow the user to select the OSP version on which the stack will run (#313)
This effects the repos used to get the os-collect-config packages. add parameters to install script added osp_version to install config agent yaml add cascade of osp_version remove director RPMs repo update location of os-collect-config files
1 parent b2dfea7 commit 19cd4d7

5 files changed

Lines changed: 44 additions & 8 deletions

File tree

bastion.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ parameters:
1414
description: >
1515
The version of OpenShift Container Platform to deploy
1616
17+
# What version of OpenStack Platform to install
18+
# This value is used to select the RPM repo for the OSP release to install
19+
osp_version:
20+
type: string
21+
default: "10"
22+
description: >
23+
The version of OpenStack Platform to use to collect data
24+
1725
key_name:
1826
description: >
1927
A pre-submitted SSH key to access the VM hosts
@@ -208,6 +216,8 @@ resources:
208216
# Install, configure and enable the Heat configuration agent
209217
config_agent:
210218
type: collect-config-setup/install_config_agent_centos_yum.yaml
219+
properties:
220+
osp_version: {get_param: osp_version}
211221

212222
# Collect the results from a set of resources
213223
init:

collect-config-setup/fragments/configure_config_agent.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ mkdir -p $oac_templates/var/run/heat-config
7474
echo "{{deployments}}" > $oac_templates/var/run/heat-config/heat-config
7575

7676
# os-refresh-config scripts directory
77-
# This moves to /usr/libexec/os-refresh-config in later releases
78-
orc_scripts=/opt/stack/os-config-refresh
77+
orc_scripts=/usr/libexec/os-refresh-config
7978
for d in pre-configure.d configure.d migration.d post-configure.d; do
8079
install -m 0755 -o root -g root -d $orc_scripts/$d
8180
done

collect-config-setup/fragments/install_config_agent_yum.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -eux
33

4+
# OSP_VERSION is set by ENV or by heat string replacement
5+
[ -n "$OSP_VERSION" ] || (echo "Missing required value OSP_VERSION" ; exit 1)
6+
47
# on Atomic host os-collect-config runs inside a container which is
58
# fetched&started in another step
69
[ -e /run/ostree-booted ] && exit 0
@@ -9,9 +12,11 @@ if ! yum info os-collect-config; then
912
# if os-collect-config package is not available, first check if
1013
# the repo is available but disabled, otherwise install the package
1114
# from epel
12-
if yum repolist disabled|grep rhel-7-server-openstack-8-director-rpms; then
13-
subscription-manager repos --enable="rhel-7-server-openstack-8-director-rpms"
14-
subscription-manager repos --enable="rhel-7-server-openstack-8-rpms"
15+
if yum repolist disabled|grep rhel-7-server-openstack-${OSP_VERSION}-rpms; then
16+
subscription-manager repos --enable="rhel-7-server-openstack-${OSP_VERSION}-rpms"
17+
if [ "$OSP_VERSION" -lt 10 ] ; then
18+
subscription-manager repos --enable="rhel-7-server-openstack-${OSP_VERSION}-director-rpms"
19+
fi
1520
else
1621
yum -y install centos-release-openstack-liberty
1722
fi

collect-config-setup/install_config_agent_centos_yum.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
heat_template_version: 2014-10-16
22

3+
parameters:
4+
5+
# What version of OpenStack Platform to install
6+
# This value is used to select the RPM repo for the OSP release to install
7+
osp_version:
8+
type: string
9+
default: "10"
10+
description: >
11+
The version of OpenStack Platform to use to collect data
12+
313
resources:
414

515
install_config_agent_yum:
616
type: "OS::Heat::SoftwareConfig"
717
properties:
818
group: ungrouped
9-
config: {get_file: fragments/install_config_agent_yum.sh}
19+
config:
20+
str_replace:
21+
params:
22+
$OSP_VERSION: {get_param: osp_version}
23+
template: {get_file: fragments/install_config_agent_yum.sh}
1024

1125
configure_config_agent:
1226
type: "OS::Heat::SoftwareConfig"
1327
properties:
1428
group: ungrouped
15-
config:
16-
get_file: fragments/configure_config_agent.sh
29+
config: {get_file: fragments/configure_config_agent.sh}
1730

1831
start_config_agent:
1932
type: "OS::Heat::SoftwareConfig"

openshift.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ parameters:
1515
description: >
1616
The version of OpenShift Container Platform to deploy
1717
18+
# What version of OpenStack Platform to install
19+
# This value is used to select the RPM repo for the OSP release to install
20+
osp_version:
21+
type: string
22+
default: "10"
23+
description: >
24+
The version of OpenStack Platform to use to collect data
25+
1826
# Access to the VMs
1927
ssh_user:
2028
type: string
@@ -517,6 +525,7 @@ resources:
517525
type: bastion.yaml
518526
properties:
519527
ocp_version: {get_param: ocp_version}
528+
osp_version: {get_param: osp_version}
520529
image: {get_param: bastion_image}
521530
flavor: {get_param: bastion_flavor}
522531
key_name: {get_param: ssh_key_name}

0 commit comments

Comments
 (0)