Skip to content

Commit 1d0456c

Browse files
author
Tomas Sedovic
authored
Merge pull request #11 from adduarte/onboarding_notes
Handle compress vm image files and added documentation
2 parents be3a3d3 + 069a674 commit 1d0456c

File tree

4 files changed

+95
-2
lines changed

4 files changed

+95
-2
lines changed

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

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

1010
# Instructions
1111

12+
## 0) Pre installation
13+
14+
Enable the appropriate openstack repo, by looking at the output of
15+
16+
`sudo yum search release-openstack`
17+
18+
and installing the desired repositories for the release you want to use. For example:
19+
20+
`sudo yum install centos-release-openstack-rocky`
21+
22+
Install OpenStack client
23+
24+
`sudo yum install python2-openstackclient`
25+
26+
Install git
27+
28+
`sudo yum install git`
29+
30+
Configure stack user to use the correct version of ansible.
31+
32+
For example, 2.9 does not support the "failed" filter, so you might have to switch to a lower version.
33+
34+
Do it at the root level because some of the playbooks run
35+
under root, so just changing it at the user level will not be enough.
36+
37+
`sudo pip uninstall ansible`
38+
39+
`sudo pip install "ansible==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` and 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+
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 forwarder for the Neutron dnsmasq and other dns services.
72+
73+
Dnsmasq is probably a good enough solution.
74+
75+
Example of /etc/dnsmasq.conf on LOCAL_IP machine, which makes machine use 192.168.122.1 as a forwarder
76+
77+
domain-needed
78+
bogus-priv
79+
server=192.168.122.1
80+
conf-dir=/etc/dnsmasq.d,.rpmnew,.rpmsave,.rpmo
81+
82+
Now the LOCAL_IP machine will respond to DNS queries using dnsmasq, and it will forward requests to 192.168.122.1 if needed.
83+
1284
## 1) Create local config
1385

1486
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

+21
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,24 @@ 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+
# Lets check to see if file is compressed with gzip
17+
# and uncompress it if so
18+
if [[ $? -eq 0 ]]
19+
then
20+
echo "$IMAGE_NAME is compressed. Expanding..."
21+
gunzip -f $IMAGE_NAME
22+
IMAGE_NAME="${IMAGE_NAME%.gz}"
23+
fi
24+
25+
# Save image with user specified name.
26+
if [ "$#" -eq 1 ]
27+
then
28+
mv $IMAGE_NAME ${1}
29+
IMAGE_NAME=${1}
30+
fi
31+
echo File saved as $IMAGE_NAME

0 commit comments

Comments
 (0)