2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
15 populate_cache "$rdo_images_uri/undercloud.qcow2"
16 if [ ! -d images ]; then mkdir images/; fi
17 cp -f cache/undercloud.qcow2 images/undercloud_build.qcow2
19 # prep opnfv-tht for undercloud
21 pushd opnfv-tht > /dev/null
22 git archive --format=tar.gz --prefix=openstack-tripleo-heat-templates/ HEAD > ../opnfv-tht.tar.gz
25 pushd images > /dev/null
26 # installing forked opnfv-tht
27 # enabling ceph OSDs to live on the controller
28 # OpenWSMan package update supports the AMT Ironic driver for the TealBox
29 # seeding configuration files specific to OPNFV
30 # add congress client and apply: https://review.openstack.org/#/c/297515/
31 # add congress password to python-triploclient
32 LIBGUESTFS_BACKEND=direct virt-customize \
33 --upload ../opnfv-tht.tar.gz:/usr/share \
34 --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf opnfv-tht.tar.gz" \
35 --run-command "sed -i '/ControllerEnableCephStorage/c\\ ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
36 --run-command "sed -i '/ComputeEnableCephStorage/c\\ ComputeEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
37 --run-command "curl http://download.opensuse.org/repositories/Openwsman/CentOS_CentOS-7/Openwsman.repo > /etc/yum.repos.d/wsman.repo" \
38 --run-command "yum update -y openwsman*" \
39 --run-command "cp /usr/share/instack-undercloud/undercloud.conf.sample /home/stack/undercloud.conf && chown stack:stack /home/stack/undercloud.conf" \
40 --upload ../opnfv-environment.yaml:/home/stack/ \
41 --upload ../virtual-environment.yaml:/home/stack/ \
42 --install "python2-congressclient" \
43 --upload ../python-congressclient.diff:/tmp \
44 --run-command "cd /usr/lib/python2.7/site-packages && patch -p1 < /tmp/python-congressclient.diff" \
45 --run-command "sed -i '/SERVICE_LIST/a\\ \x27congress\x27: {\x27password_field\x27: \x27OVERCLOUD_CONGRESS_PASSWORD\x27},' /usr/lib/python2.7/site-packages/tripleoclient/constants.py" \
46 --run-command "sed -i '/PASSWORD_NAMES =/a\\ \"OVERCLOUD_CONGRESS_PASSWORD\",' /usr/lib/python2.7/site-packages/tripleoclient/utils.py" \
47 --run-command "sed -i '/AodhPassword/a\\ parameters\[\x27CongressPassword\x27\] = passwords\[\x27OVERCLOUD_CONGRESS_PASSWORD\x27\]' /usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py" \
48 --run-command "sed -i '/^SERVICES/a\ \x27congress\x27: {\x27description\x27: \x27Congress Service\x27, \x27type\x27: \x27policy\x27, \x27path\x27: \x27/\x27, \x27port\x27: 1789 },' /usr/lib/python2.7/site-packages/os_cloud_config/keystone.py" \
49 -a undercloud_build.qcow2
51 # Add custom IPA to allow kernel params
52 wget https://raw.githubusercontent.com/trozet/ironic-python-agent/opnfv_kernel/ironic_python_agent/extensions/image.py
53 python3.4 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")'
55 # Add performance image scripts
56 LIBGUESTFS_BACKEND=direct virt-customize --upload ../build_perf_image.sh:/home/stack \
57 --upload ../set_perf_images.sh:/home/stack \
58 --upload image.py:/root \
59 --upload image.pyc:/root \
60 -a undercloud_build.qcow2
62 mv -f undercloud_build.qcow2 undercloud.qcow2