Merge "Restructured the installation-instruction file into indexed sub files"
[apex.git] / build / instack.sh
index 958681b..eb017c2 100755 (executable)
@@ -4,6 +4,7 @@ declare -i CNT
 
 #rdo_images_uri=https://repos.fedorapeople.org/repos/openstack-m/rdo-images-centos-liberty-opnfv
 rdo_images_uri=file:///stable-images
+onos_artifacts_uri=file:///stable-images/onos
 
 vm_index=4
 RDO_RELEASE=liberty
@@ -62,7 +63,7 @@ fi
 cat << 'EOF' | sudo tee /etc/yum.repos.d/opendaylight.repo
 [opendaylight]
 name=OpenDaylight $releasever - $basearch
-baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-3-candidate/$basearch/os/
+baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-33-release/$basearch/os/
 enabled=1
 gpgcheck=0
 EOF
@@ -225,8 +226,14 @@ PACKAGES+=",openstack-nova-api,openstack-nova-cert,openstack-heat-api-cfn,openst
 PACKAGES+=",openstack-ceilometer-central,openstack-ceilometer-polling,openstack-ceilometer-collector,"
 PACKAGES+=",openstack-heat-api-cloudwatch,openstack-heat-engine,openstack-heat-common,openstack-ceilometer-notification"
 PACKAGES+=",hiera,puppet,memcached,keepalived,mariadb,mariadb-server,rabbitmq-server,python-pbr,python-proliantutils"
-
-LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES -a instack.qcow2
+PACKAGES+=",ceph-common"
+
+# install the packages above and enabling ceph to live on the controller
+LIBGUESTFS_BACKEND=direct virt-customize --install $PACKAGES \
+    --run-command "sed -i '/ControllerEnableCephStorage/c\\  ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \
+    --run-command "sed -i '/  \$enable_ceph = /c\\  \$enable_ceph = true' /usr/share/openstack-tripleo-heat-templates/puppet/manifests/overcloud_controller_pacemaker.pp" \
+    --run-command "sed -i '/  \$enable_ceph = /c\\  \$enable_ceph = true' /usr/share/openstack-tripleo-heat-templates/puppet/manifests/overcloud_controller.pp" \
+    -a instack.qcow2
 popd
 
 
@@ -235,17 +242,19 @@ pushd stack
 # make a copy of the cached overcloud-full image
 cp overcloud-full.qcow2 overcloud-full-odl.qcow2
 
-# remove unnessesary packages and install nessesary packages
+# remove unnecessary packages and install necessary packages
 LIBGUESTFS_BACKEND=direct virt-customize --run-command "yum remove -y openstack-neutron-openvswitch" \
+    --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
     --upload /etc/yum.repos.d/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
-    --install opendaylight,python-networking-odl -a overcloud-full-odl.qcow2
+    --install opendaylight,python-networking-odl,ceph \
+    -a overcloud-full-odl.qcow2
 
 ## WORK AROUND
 ## when OpenDaylight lands in upstream RDO manager this can be removed
 
 # upload the opendaylight puppet module
 rm -rf puppet-opendaylight
-git clone https://github.com/dfarrell07/puppet-opendaylight
+git clone -b 2.2.0 https://github.com/dfarrell07/puppet-opendaylight
 pushd puppet-opendaylight
 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ../puppet-opendaylight.tar.gz
 popd
@@ -253,12 +262,40 @@ LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-opendaylight.tar.gz:/et
                                          --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" -a overcloud-full-odl.qcow2
 
 # Patch in OpenDaylight installation and configuration
-LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-tripleo-heat-templates.patch:/tmp \
-                                         --run-command "cd /usr/share/openstack-tripleo-heat-templates/ && patch -Np1 < /tmp/opendaylight-tripleo-heat-templates.patch" \
+LIBGUESTFS_BACKEND=direct virt-customize --upload ../opnfv-tripleo-heat-templates.patch:/tmp \
+                                         --run-command "cd /usr/share/openstack-tripleo-heat-templates/ && patch -Np1 < /tmp/opnfv-tripleo-heat-templates.patch" \
                                          -a instack.qcow2
 LIBGUESTFS_BACKEND=direct virt-customize --upload ../opendaylight-puppet-neutron.patch:/tmp \
                                          --run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/opendaylight-puppet-neutron.patch" \
                                          -a overcloud-full-odl.qcow2
+# REMOVE ME AFTER Brahmaputra
+LIBGUESTFS_BACKEND=direct virt-customize --upload ../puppet-neutron-force-metadata.patch:/tmp \
+                                         --run-command "cd /etc/puppet/modules/neutron && patch -Np1 < /tmp/puppet-neutron-force-metadata.patch" \
+                                         -a overcloud-full-odl.qcow2
+## END WORK AROUND
+popd
+
+## WORK AROUND
+## when ONOS lands in upstream OPNFV artifacts this can be removed
+
+# upload the onos puppet module
+pushd stack
+
+rm -rf puppet-onos
+git clone https://github.com/bobzhouHW/puppet-onos.git
+pushd puppet-onos
+# download jdk, onos and maven dependancy packages.
+pushd files
+curl ${onos_artifacts_uri}/jdk-8u51-linux-x64.tar.gz -o ./jdk-8u51-linux-x64.tar.gz
+curl ${onos_artifacts_uri}/onos-1.3.0.tar.gz -o ./onos-1.3.0.tar.gz
+curl ${onos_artifacts_uri}/repository.tar -o ./repository.tar
+popd
+popd
+mv puppet-onos onos
+tar -czf puppet-onos.tar.gz onos
+LIBGUESTFS_BACKEND=direct virt-customize --upload puppet-onos.tar.gz:/etc/puppet/modules/ \
+                                         --run-command "cd /etc/puppet/modules/ && tar xzf puppet-onos.tar.gz" -a overcloud-full-odl.qcow2
+
 ## END WORK AROUND
 popd