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 "$BUILD_DIR" ]; then mkdir ${BUILD_DIR}; fi
17 cp -f ${CACHE_DIR}/undercloud.qcow2 ${BUILD_DIR}/undercloud_build.qcow2
19 pushd ${BUILD_DIR} > /dev/null
21 # prep opnfv-tht for undercloud
23 pushd opnfv-tht > /dev/null
24 git archive --format=tar.gz --prefix=openstack-tripleo-heat-templates/ HEAD > ${BUILD_DIR}/opnfv-tht.tar.gz
27 # inject rt_kvm kernel rpm name into the enable file
28 sed "s/kvmfornfv_kernel.rpm/$kvmfornfv_kernel_rpm/" ${BUILD_ROOT}/enable_rt_kvm.yaml | tee ${BUILD_DIR}/enable_rt_kvm.yaml
30 # installing forked opnfv-tht
31 # enabling ceph OSDs to live on the controller
32 # OpenWSMan package update supports the AMT Ironic driver for the TealBox
33 # seeding configuration files specific to OPNFV
35 # add congress password to python-tripleoclient
36 # add tacker password to tripleo-common
37 # upload tacker repo and install the client package
38 # Add performance image scripts
39 # hack for disabling undercloud package update
40 LIBGUESTFS_BACKEND=direct virt-customize \
41 --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
42 --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
43 --upload ${BUILD_DIR}/opnfv-tht.tar.gz:/usr/share \
44 --install "openstack-utils" \
45 --install "ceph-common" \
46 --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf opnfv-tht.tar.gz" \
47 --run-command "sed -i '/ControllerEnableCephStorage/c\\ ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
48 --run-command "sed -i '/ComputeEnableCephStorage/c\\ ComputeEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
49 --run-command "curl -f http://download.opensuse.org/repositories/Openwsman/CentOS_CentOS-7/Openwsman.repo > /etc/yum.repos.d/wsman.repo" \
50 --run-command "yum update -y openwsman*" \
51 --run-command "cp /usr/share/instack-undercloud/undercloud.conf.sample /home/stack/undercloud.conf && chown stack:stack /home/stack/undercloud.conf" \
52 --upload ${BUILD_ROOT}/opnfv-environment.yaml:/home/stack/ \
53 --upload ${BUILD_ROOT}/first-boot.yaml:/home/stack/ \
54 --upload ${BUILD_ROOT}/kvm4nfv-1st-boot.yaml:/home/stack/ \
55 --upload ${BUILD_DIR}/enable_rt_kvm.yaml:/home/stack/ \
56 --upload ${BUILD_ROOT}/ovs-dpdk-preconfig.yaml:/home/stack/ \
57 --upload ${BUILD_ROOT}/csit-environment.yaml:/home/stack/ \
58 --upload ${BUILD_ROOT}/virtual-environment.yaml:/home/stack/ \
59 --install "python2-congressclient" \
60 --run-command "sed -i '/SwiftPassword/a\ \x27TackerPassword\x27,' /usr/lib/python2.7/site-packages/tripleo_common/constants.py" \
61 --run-command "sed -i '/CinderPassword/a\ \x27CongressPassword\x27,' /usr/lib/python2.7/site-packages/tripleo_common/constants.py" \
62 --upload ${BUILD_DIR}/noarch/$tackerclient_pkg:/root/ \
63 --install /root/$tackerclient_pkg \
64 --install "python2-aodhclient" \
65 --install "openstack-heat-engine" \
66 --install "openstack-heat-api-cfn" \
67 --install "openstack-heat-api" \
68 --upload ${BUILD_ROOT}/patches/0001-Removes-doing-yum-update.patch:/usr/lib/python2.7/site-packages/ \
69 --run-command "cd /usr/lib/python2.7/site-packages/ && patch -p1 < 0001-Removes-doing-yum-update.patch" \
70 --root-password password:stack \
71 -a undercloud_build.qcow2
73 mv -f undercloud_build.qcow2 undercloud.qcow2