Merge "[BGPVPN] Remove setup_TEPS"
[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 ${BUILD_DIR} > /dev/null
14
15 cp -f overcloud-full.qcow2 overcloud-full-opendaylight_build.qcow2
16
17 ###############################################
18 #####    Adding OpenDaylight to overcloud #####
19 ###############################################
20
21 # tar up fdio networking-odl
22 rm -rf fds
23 git clone https://gerrit.opnfv.org/gerrit/fds
24 pushd fds > /dev/null
25 tar -czvf ${BUILD_DIR}/networking-odl.tar.gz networking-odl
26 popd > /dev/null
27
28 # Beryllium Repo
29 cat > ${BUILD_DIR}/opendaylight.repo << EOF
30 [opendaylight-4-release]
31 name=CentOS CBS OpenDaylight Beryllium repository
32 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-4-release/\$basearch/os/
33 enabled=1
34 gpgcheck=0
35 EOF
36
37 # Boron Repo
38 cat > ${BUILD_DIR}/opendaylight_boron.repo << EOF
39 [opendaylight-5-release]
40 name=CentOS CBS OpenDaylight Boron repository
41 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-5-testing/\$basearch/os/
42 enabled=1
43 gpgcheck=0
44 EOF
45
46 # Master Repo
47 cat > ${BUILD_DIR}/opendaylight_master.repo << EOF
48 [opendaylight-6-release]
49 name=CentOS CBS OpenDaylight Carbon repository
50 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-6-testing/\$basearch/os/
51 enabled=1
52 gpgcheck=0
53 EOF
54
55 #BGPVPN Repo
56 cat > ${BUILD_DIR}/bgpvpn.repo << EOF
57 [bgpvpn]
58 name=bgpvpn
59 baseurl=https://trunk.rdoproject.org/centos7/consistent/
60 includepkgs=python2-networking-bgpvpn
61 enabled=1
62 gpgcheck=0
63 priority=1
64 EOF
65
66 # OpenDaylight Puppet Module
67 rm -rf puppet-opendaylight
68 git clone -b master https://github.com/dfarrell07/puppet-opendaylight
69 pushd puppet-opendaylight > /dev/null
70 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight.tar.gz
71 popd > /dev/null
72
73 # install ODL packages
74 # install Jolokia for ODL HA
75 # Patch in OPNFV custom puppet-tripleO
76 # install Honeycomb
77 LIBGUESTFS_BACKEND=direct virt-customize \
78     --upload ${BUILD_DIR}/networking-odl.tar.gz:/root/ \
79     --upload ${BUILD_DIR}/opendaylight_boron.repo:/etc/yum.repos.d/opendaylight.repo \
80     --run-command "yum install --downloadonly --downloaddir=/root/boron/ opendaylight" \
81     --upload ${BUILD_DIR}/opendaylight_master.repo:/etc/yum.repos.d/opendaylight.repo \
82     --run-command "yum install --downloadonly --downloaddir=/root/master/ opendaylight" \
83     --upload ${BUILD_DIR}/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
84     --install opendaylight,python-networking-odl \
85     --upload ${BUILD_DIR}/bgpvpn.repo:/etc/yum.repos.d/bgpvpn.repo \
86     --install python-networking-bgpvpn \
87     --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" \
88     --run-command "tar -xvf /tmp/jolokia-1.3.3-bin.tar.gz -C /opt/opendaylight/system/org" \
89     --install honeycomb \
90     --upload ${BUILD_DIR}/puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
91     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \
92     -a overcloud-full-opendaylight_build.qcow2
93
94 mv overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
95 popd > /dev/null