Merge "Enable ceph on boot"
[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 # 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 ../networking-odl.tar.gz networking-odl
26 popd > /dev/null
27
28 # Beryllium Repo
29 cat > /tmp/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 > /tmp/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 # SDNVPN - Copy tunnel setup script
47 wget https://raw.githubusercontent.com/openstack/fuel-plugin-opendaylight/brahmaputra-sr2/deployment_scripts/puppet/modules/opendaylight/templates/setup_TEPs.py
48
49 # tar up the honeycomb module
50 rm -rf puppet-honeycomb
51 git clone https://github.com/trozet/puppet-honeycomb
52 pushd puppet-honeycomb > /dev/null
53 git archive --format=tar.gz --prefix=honeycomb/ HEAD > ../puppet-honeycomb.tar.gz
54 popd > /dev/null
55
56 # install ODL packages
57 # install Jolokia for ODL HA
58 # Patch in OPNFV custom puppet-tripleO
59 # install Honeycomb
60 # install Honeycomb puppet module
61 LIBGUESTFS_BACKEND=direct virt-customize \
62     --upload networking-odl.tar.gz:/root/ \
63     --upload /tmp/opendaylight_boron.repo:/etc/yum.repos.d/opendaylight.repo \
64     --run-command "yum install --downloadonly --downloaddir=/root/boron/ opendaylight" \
65     --upload /tmp/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
66     --install opendaylight,python-networking-odl \
67     --install https://github.com/michaeltchapman/networking_rpm/raw/master/openstack-neutron-bgpvpn-2015.2-1.el7.centos.noarch.rpm \
68     --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" \
69     --run-command "tar -xvf /tmp/jolokia-1.3.3-bin.tar.gz -C /opt/opendaylight/system/org" \
70     --run-command "yum -y install https://github.com/marosmars/files/raw/master/honeycomb-1.0.0-99.noarch.rpm" \
71     --upload puppet-honeycomb.tar.gz:/etc/puppet/modules \
72     --run-command "cd /etc/puppet/modules && tar xzf puppet-honeycomb.tar.gz" \
73     --upload ./setup_TEPs.py:/tmp \
74     -a overcloud-full-opendaylight_build.qcow2
75
76     # Move these two lines above the -a overcloud-full-opendaylight_build.qcow2 when the patch has been rebased
77     #--upload ../opnfv-puppet-tripleo.patch:/tmp \
78     #--run-command "cd /etc/puppet/modules/tripleo && patch -Np1 < /tmp/opnfv-puppet-tripleo.patch" \
79
80 ## WORK AROUND
81 ## when OpenDaylight lands in upstream RDO manager this can be removed
82
83 # upload the opendaylight puppet module
84 rm -rf puppet-opendaylight
85 git clone -b opnfv_integration https://github.com/dfarrell07/puppet-opendaylight
86 pushd puppet-opendaylight > /dev/null
87 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz
88 popd > /dev/null
89 LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
90                                          --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \
91                                          -a overcloud-full-opendaylight_build.qcow2
92
93 mv overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
94 popd > /dev/null