Adds ability to deploy from upstream openstack
[apex.git] / build / undercloud.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
4 #
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 ##############################################################################
10 set -xe
11 source ./cache.sh
12 source ./variables.sh
13
14 populate_cache "$rdo_images_uri/undercloud.qcow2"
15 if [ ! -d "$BUILD_DIR" ]; then mkdir ${BUILD_DIR}; fi
16 cp -f ${CACHE_DIR}/undercloud.qcow2 ${BUILD_DIR}/undercloud_build.qcow2
17
18 pushd ${BUILD_DIR} > /dev/null
19
20 # prep apex-tht for undercloud
21 python3 -B $BUILD_UTILS clone-fork -r apex-tripleo-heat-templates
22 pushd apex-tripleo-heat-templates > /dev/null
23 git archive --format=tar.gz --prefix=openstack-tripleo-heat-templates/ HEAD > ${BUILD_DIR}/apex-tripleo-heat-templates.tar.gz
24 popd > /dev/null
25
26 # inject rt_kvm kernel rpm name into the enable file
27 sed "s/kvmfornfv_kernel.rpm/$kvmfornfv_kernel_rpm/" ${BUILD_ROOT}/enable_rt_kvm.yaml | tee ${BUILD_DIR}/enable_rt_kvm.yaml
28
29 # grab latest calipso
30 populate_cache $calipso_uri_base/$calipso_script
31
32 # Turn off GSSAPI Auth in sshd
33 # installing forked apex-tht
34 # enabling ceph OSDs to live on the controller
35 # seeding configuration files specific to OPNFV
36 # Add performance image scripts
37 # Override delorean repo with current tripleo (REMOVE when upgrading to Pike)
38 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
39     --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
40     --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
41     --upload ${BUILD_DIR}/apex-tripleo-heat-templates.tar.gz:/usr/share \
42     --install "openstack-utils" \
43     --install "ceph-common" \
44     --install "http://mirror.centos.org/centos/7/cloud/x86_64/openstack-ocata/python2-networking-sfc-4.0.0-1.el7.noarch.rpm" \
45     --run-command "cd /etc/yum.repos.d && curl -O https://trunk.rdoproject.org/centos7-ocata/current-tripleo/delorean.repo" \
46     --install openstack-nova-compute \
47     --install epel-release \
48     --install python34,python34-pip \
49     --install openstack-ironic-inspector,subunit-filters,docker-distribution,openstack-tripleo-validations \
50     --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf apex-tripleo-heat-templates.tar.gz" \
51     --run-command "sed -i '/ControllerEnableCephStorage/c\\  ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
52     --run-command "sed -i '/ComputeEnableCephStorage/c\\  ComputeEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
53     --run-command "cp /usr/share/instack-undercloud/undercloud.conf.sample /home/stack/undercloud.conf && chown stack:stack /home/stack/undercloud.conf" \
54     --upload ${BUILD_ROOT}/opnfv-environment.yaml:/home/stack/ \
55     --upload ${BUILD_ROOT}/first-boot.yaml:/home/stack/ \
56     --upload ${BUILD_DIR}/enable_rt_kvm.yaml:/usr/share/openstack-tripleo-heat-templates/environments/ \
57     --upload ${BUILD_ROOT}/ovs-dpdk-preconfig.yaml:/home/stack/ \
58     --upload ${BUILD_ROOT}/csit-environment.yaml:/home/stack/ \
59     --upload ${BUILD_ROOT}/virtual-environment.yaml:/home/stack/ \
60     --upload ${BUILD_ROOT}/baremetal-environment.yaml:/home/stack/ \
61     --uninstall "libvirt-client" \
62     --upload ${CACHE_DIR}/${calipso_script}:/root/ \
63     --install "libguestfs-tools" \
64     --install "python-tackerclient" \
65     --upload ${BUILD_ROOT}/patches/tacker-client-fix-symmetrical.patch:/usr/lib/python2.7/site-packages/ \
66     --run-command "cd usr/lib/python2.7/site-packages/ && patch -p1 < tacker-client-fix-symmetrical.patch" \
67     --run-command "yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo" \
68     --install yum-utils,lvm2,device-mapper-persistent-data \
69     -a undercloud_build.qcow2
70
71 mv -f undercloud_build.qcow2 undercloud.qcow2
72 popd > /dev/null