Merge "updating undercloud build"
[apex.git] / build / overcloud-opendaylight.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 -e
11 source ./variables.sh
12
13 pushd images > /dev/null
14
15 cp -f overcloud-full.qcow2 overcloud-full-opendaylight_build.qcow2
16
17 ###############################################
18 #####    Adding OpenDaylight to overcloud #####
19 ###############################################
20
21 # Beryllium Repo
22 cat > /tmp/opendaylight.repo << EOF
23 [opendaylight-4-release]
24 name=CentOS CBS OpenDaylight Beryllium repository
25 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-4-release/\$basearch/os/
26 enabled=1
27 gpgcheck=0
28 EOF
29
30 # Boron Repo
31 cat > /tmp/opendaylight_boron.repo << EOF
32 [opendaylight-5-release]
33 name=CentOS CBS OpenDaylight Boron repository
34 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-5-testing/\$basearch/os/
35 enabled=1
36 gpgcheck=0
37 EOF
38
39 # install ODL packages
40 # install Jolokia for ODL HA
41 # Patch in OPNFV custom puppet-tripleO
42 LIBGUESTFS_BACKEND=direct virt-customize \
43     --upload /tmp/opendaylight_boron.repo:/etc/yum.repos.d/opendaylight.repo \
44     --run-command "yum install --downloadonly --downloaddir=/root/boron/ opendaylight" \
45     --upload /tmp/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
46     --install opendaylight,python-networking-odl \
47     --install https://github.com/michaeltchapman/networking_rpm/raw/master/openstack-neutron-bgpvpn-2015.2-1.el7.centos.noarch.rpm \
48     --run-command "wget https://github.com/rhuss/jolokia/releases/download/v1.3.3/jolokia-1.3.3-bin.tar.gz -O /tmp/jolokia-1.3.3-bin.tar.gz" \
49     --run-command "tar -xvf /tmp/jolokia-1.3.3-bin.tar.gz -C /opt/opendaylight/system/org" \
50     -a overcloud-full-opendaylight_build.qcow2
51
52     # Move these two lines above the -a overcloud-full-opendaylight_build.qcow2 when the patch has been rebased
53     #--upload ../opnfv-puppet-tripleo.patch:/tmp \
54     #--run-command "cd /etc/puppet/modules/tripleo && patch -Np1 < /tmp/opnfv-puppet-tripleo.patch" \
55
56 ## WORK AROUND
57 ## when OpenDaylight lands in upstream RDO manager this can be removed
58
59 # upload the opendaylight puppet module
60 rm -rf puppet-opendaylight
61 git clone -b opnfv_integration https://github.com/dfarrell07/puppet-opendaylight
62 pushd puppet-opendaylight > /dev/null
63 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz
64 popd > /dev/null
65 LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
66                                          --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \
67                                          -a overcloud-full-opendaylight_build.qcow2
68
69 mv overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
70 popd > /dev/null