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
31 # add congress password to python-tripleoclient
32 # add tacker password to python-tripleoclient
33 # upload tacker repo and install the client package
34 LIBGUESTFS_BACKEND=direct virt-customize \
35 --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
36 --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
37 --upload ../opnfv-tht.tar.gz:/usr/share \
38 --install "openstack-utils" \
39 --install "ceph-common" \
40 --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf opnfv-tht.tar.gz" \
41 --run-command "sed -i '/ControllerEnableCephStorage/c\\ ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
42 --run-command "sed -i '/ComputeEnableCephStorage/c\\ ComputeEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
43 --run-command "curl http://download.opensuse.org/repositories/Openwsman/CentOS_CentOS-7/Openwsman.repo > /etc/yum.repos.d/wsman.repo" \
44 --run-command "yum update -y openwsman*" \
45 --run-command "cp /usr/share/instack-undercloud/undercloud.conf.sample /home/stack/undercloud.conf && chown stack:stack /home/stack/undercloud.conf" \
46 --upload ../opnfv-environment.yaml:/home/stack/ \
47 --upload ../virtual-environment.yaml:/home/stack/ \
48 --install "python2-congressclient" \
49 --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" \
50 --run-command "sed -i '/PASSWORD_NAMES =/a\\ \"OVERCLOUD_CONGRESS_PASSWORD\",' /usr/lib/python2.7/site-packages/tripleoclient/utils.py" \
51 --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" \
52 --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" \
53 --run-command "sed -i '/SERVICE_LIST/a\\ \x27tacker\x27: {\x27password_field\x27: \x27OVERCLOUD_TACKER_PASSWORD\x27},' /usr/lib/python2.7/site-packages/tripleoclient/constants.py" \
54 --run-command "sed -i '/PASSWORD_NAMES =/a\\ \"OVERCLOUD_TACKER_PASSWORD\",' /usr/lib/python2.7/site-packages/tripleoclient/utils.py" \
55 --run-command "sed -i '/AodhPassword/a\\ parameters\[\x27TackerPassword\x27\] = passwords\[\x27OVERCLOUD_TACKER_PASSWORD\x27\]' /usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py" \
56 --run-command "sed -i '/^SERVICES/a\ \x27tacker\x27: {\x27description\x27: \x27Tacker Service\x27, \x27type\x27: \x27servicevm\x27, \x27path\x27: \x27/\x27, \x27port\x27: 8888 },' /usr/lib/python2.7/site-packages/os_cloud_config/keystone.py" \
57 --upload ../noarch/python-tackerclient-2015.2-1.trozet.noarch.rpm:/root/ \
58 --install /root/python-tackerclient-2015.2-1.trozet.noarch.rpm \
59 --install "python2-aodhclient" \
60 --install "openstack-heat-engine" \
61 --install "openstack-heat-api-cfn" \
62 --install "openstack-heat-api" \
63 -a undercloud_build.qcow2
65 # Add custom IPA to allow kernel params
66 wget https://raw.githubusercontent.com/trozet/ironic-python-agent/opnfv_kernel/ironic_python_agent/extensions/image.py
67 python3 -c 'import py_compile; py_compile.compile("image.py", cfile="image.pyc")'
69 # Add performance image scripts
70 LIBGUESTFS_BACKEND=direct virt-customize --upload ../build_perf_image.sh:/home/stack \
71 --upload ../set_perf_images.sh:/home/stack \
72 --upload image.py:/root \
73 --upload image.pyc:/root \
74 -a undercloud_build.qcow2
76 mv -f undercloud_build.qcow2 undercloud.qcow2