Skip to content

Commit 0414066

Browse files
author
Adolfo Duarte
committed
Uncompressing vm image file
- The filename used for the vm images has changed, and the files are now compressed with gzip so after downloading they need to be uncompress. Also the filename used to save the qcow2 files is programatically determined. - If a newer vesion of tmate is installed script shoudl not exit with error. - Enhanced documentation
1 parent be3a3d3 commit 0414066

5 files changed

+92
-4
lines changed

01_install_requirements.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -x
2+
set -xe
33

44
source common.sh
55

@@ -11,8 +11,9 @@ sudo yum -y update
1111

1212
sudo yum -y install epel-release
1313
sudo yum -y install curl vim-enhanced wget python-pip patch psmisc figlet golang
14+
set +e
1415
sudo yum -y install https://dprince.fedorapeople.org/tmate-2.2.1-1.el7.centos.x86_64.rpm
15-
16+
set -e
1617
# for tripleo-repos install:
1718
sudo yum -y install python-setuptools python-requests
1819

03_configure_undercloud.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if ! openstack image show cirros; then
3838
openstack image create cirros --container-format bare --disk-format qcow2 --public --file "$CIRROS_IMAGE_FILENAME"
3939
fi
4040

41-
./get-rhcos-image.sh
41+
./get-rhcos-image.sh $RHCOS_IMAGE_FILENAME
4242
RHOS_IMAGE_HASH=$(sha512sum $RHCOS_IMAGE_FILENAME | awk '{print $1}')
4343
if ! openstack image show rhcos; then
4444
openstack image create rhcos --container-format bare --disk-format qcow2 --public --file $RHCOS_IMAGE_FILENAME

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,74 @@ OpenShift Installer OpenStack Dev Scripts
99

1010
# Instructions
1111

12+
## 0) Pre installation
13+
14+
Enable the appropriate openstack repo.
15+
From the output of
16+
17+
`sudo yum search release-openstack`
18+
19+
install the desired repositories for the release you want to use. For example:
20+
21+
`sudo yum install centos-release-openstack-rocky`
22+
23+
Install openstack client
24+
25+
`sudo yum install python2-openstackclient`
26+
27+
Install git
28+
29+
`sudo yum install git`
30+
31+
Configure stack user to use ansible <2.9 (2.9 does not support he "failed" filter).
32+
We have to do it at the root level because some of the playbooks apperantly are run
33+
under root, so just changing it at the user level will not work.
34+
35+
`sudo pip uninstall ansible`
36+
37+
`sudo pip install "ansible==2.8.7"`
38+
39+
Then verify that you ansible version is 2.8.7
40+
41+
`ansible --version`
42+
43+
Clone this repository:
44+
45+
`cd <to_wherever_you_want_this_source_code_to_live`
46+
47+
`git clone <this repos address>`
48+
49+
50+
CD to repo
51+
52+
`cd ocp-doit`
53+
54+
Get the lastest artifacts hash for the tripleo if you want to use it, and set it in common.sh
55+
you can get it from:
56+
57+
` https://trunk.rdoproject.org/centos7/current-tripleo/commit.yaml`
58+
59+
by joining the `commit_hash` with the first 8 characters of the `distro_hash` with a `_`.
60+
For example:
61+
62+
commit_hash: 38c4e3104abdeb4699cfbe7a78fa2f37d7a863b4
63+
distgit_dir: /home/centos-master-uc/data/puppet-manila_distro/
64+
distro_hash: 93bde36c78d20a482068674c1391725cdf89b6d9
65+
66+
then the hash becomes:
67+
68+
`38c4e3104abdeb4699cfbe7a78fa2f37d7a863b4_93bde36c`
69+
70+
Install and configure a dns server on the host machine (The machine with the LOCAL_IP address). The LOCAL_IP
71+
address is used as the dns server for the host as well as the forwarder for the Neutron dnsmasq and other dns services.
72+
73+
example /etc/dnsmasq.conf
74+
75+
domain-needed
76+
bogus-priv
77+
server=192.168.122.1
78+
conf-dir=/etc/dnsmasq.d,.rpmnew,.rpmsave,.rpmo
79+
1280
## 1) Create local config
1381

1482
Create a config file based on the example and set values appropriate for your

common.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="registry.svc.ci.openshift.org/o
2929
# We'll have to check once in a while for a new version though.
3030
# You can get the latest hash here:
3131
# https://trunk.rdoproject.org/centos7/current-tripleo/commit.yaml
32-
TRIPLEO_VERSION='25698ebfff692178450478b5207b09ca99d277b2_aba8ec54'
32+
TRIPLEO_VERSION='38c4e3104abdeb4699cfbe7a78fa2f37d7a863b4_93bde36c'
3333

3434
# Use some color to highlight actionable output
3535
highlight() {

get-rhcos-image.sh

+19
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,22 @@ echo "Downloading RHCOS image from:"
88
echo "$IMAGE_URL"
99

1010
curl --insecure --compressed -L -O "$IMAGE_URL"
11+
12+
IMAGE_NAME=$(echo "${IMAGE_URL##*/}")
13+
14+
gzip -l $IMAGE_NAME >/dev/null 2>&1
15+
16+
if [[ $? -eq 0 ]]
17+
then
18+
echo "$IMAGE_NAME is compressed. Expanding..."
19+
gunzip -f $IMAGE_NAME
20+
IMAGE_NAME="${IMAGE_NAME%.gz}"
21+
fi
22+
23+
24+
if [ "$#" -eq 1 ]
25+
then
26+
mv $IMAGE_NAME ${1}
27+
IMAGE_NAME=${1}
28+
fi
29+
echo File saved as $IMAGE_NAME

0 commit comments

Comments
 (0)