Skip to content

Instantly share code, notes, and snippets.

@rickerc
Last active August 29, 2015 13:57
Show Gist options
  • Save rickerc/9842263 to your computer and use it in GitHub Desktop.
Save rickerc/9842263 to your computer and use it in GitHub Desktop.
install_icehouse_ubuntu
#!/bin/bash
#
# assumption is starting with a generic minimal install of Ubuntu trusty
#
# this will install an all_in_one using puppetry from a Cisco repo;
# all other packages including OpenStack packages come from Ubuntu trusty
# general cleanup - kill any repos and puppet cobbler may have added
rm -f /etc/apt/sources.list.d/*
apt-get update
apt-get remove --purge --yes puppet puppet-common
apt-get autoremove --purge --yes
# add our new puppet repo and get debs
wget -qO- http://openstack-repo.cisco.com/openstack/APT-GPG-KEY-Cisco-Puppet | apt-key add -
cat > /etc/apt/sources.list.d/cisco-openstack-puppet-mirror_icehouse.list<<EOF
# cisco-openstack-puppet-mirror_icehouse
deb http://openstack-repo.cisco.com/openstack/puppet icehouse-proposed main
deb-src http://openstack-repo.cisco.com/openstack/puppet icehouse-proposed main
EOF
apt-get update && apt-get dist-upgrade -y && apt-get install -y git cpu-checker
# get and fix puppet_openstack_builder
cd
git clone -b icehouse https://github.com/CiscoSystems/puppet_openstack_builder
cd puppet_openstack_builder
# temp bug fixes / workarounds before install
#
# https://bugs.launchpad.net/openstack-cisco/+bug/1304579 - connection errors due to mysql config
git fetch https://review.openstack.org/stackforge/puppet_openstack_builder refs/changes/33/88033/5 && git cherry-pick -x FETCH_HEAD
#
# https://bugs.launchpad.net/openstack-cisco/+bug/1322210 - rabbitmq erlang cookie issue
git fetch https://review.openstack.org/stackforge/puppet_openstack_builder refs/changes/02/94902/1 && git cherry-pick -x FETCH_HEAD
#
# https://bugs.launchpad.net/openstack-cisco/+bug/1322282 - horizon using wrong endpoint
git fetch https://review.openstack.org/stackforge/puppet_openstack_builder refs/changes/56/94956/1 && git cherry-pick -x FETCH_HEAD
#
# https://bugs.launchpad.net/openstack-cisco/+bug/1322284 - default vhost breaking stuff
git fetch https://review.openstack.org/stackforge/puppet_openstack_builder refs/changes/59/94959/1 && git cherry-pick -x FETCH_HEAD
#
# https://bugs.launchpad.net/openstack-cisco/+bug/1302088 - charset / collate for latin1 db
echo '# Default character set and collation order for MySQL' >> data/hiera_data/common.yaml
echo 'mysql_default_charset: utf8' >> data/hiera_data/common.yaml
echo 'mysql_default_collation: utf8_unicode_ci' >> data/hiera_data/common.yaml
echo '# MySQL char set and collation order' >> data/data_mappings/common.yaml
echo 'mysql_default_charset:' >> data/data_mappings/common.yaml
echo ' - ceilometer::db::mysql::charset' >> data/data_mappings/common.yaml
echo ' - nova::db::mysql::charset' >> data/data_mappings/common.yaml
echo 'mysql_default_collation:' >> data/data_mappings/common.yaml
echo ' - ceilometer::db::mysql::collate' >> data/data_mappings/common.yaml
echo ' - nova::db::mysql::collate' >> data/data_mappings/common.yaml
# repo fixes
echo "coe::base::supplemental_repo: false" >> data/hiera_data/user.common.yaml
# https://bugs.launchpad.net/openstack-cisco/+bug/1321734 - galera active/passive reconfigure
git fetch https://review.openstack.org/stackforge/puppet_openstack_builder refs/changes/38/94738/1 && git cherry-pick -x FETCH_HEAD
wget -qO- https://github.com/CiscoSystems/puppet_openstack_builder/pull/84.diff | patch -p1
apt-get install puppet-openstack-ha
cd /usr/share/puppet/modules/openstack-ha
wget -qO- https://github.com/CiscoSystems/puppet-openstack-ha/pull/19.diff | patch -p1
cd /root/puppet_openstack_builder
sed -i '/openstack-ha$/d' modules.list
# https://bugs.launchpad.net/openstack-cisco/+bug/1314774 - glance dependency issue
cd /usr/share/puppet/modules
git clone -b icehouse https://github.com/CiscoSystems/puppet-glance glance
cd glance
git fetch https://review.openstack.org/stackforge/puppet-glance refs/changes/00/95800/1 && git cherry-pick -x FETCH_HEAD
cd /root/puppet_openstack_builder
sed -i '/glance$/d' modules.list
# https://bugs.launchpad.net/openstack-cisco/+bug/1314772 - swift dependency issue
cd /usr/share/puppet/modules
git clone -b icehouse https://github.com/CiscoSystems/puppet-swift swift
cd swift
git fetch https://review.openstack.org/stackforge/puppet-swift refs/changes/59/95259/1 && git cherry-pick -x FETCH_HEAD
cd /root/puppet_openstack_builder
sed -i '/swift$/d' modules.list
# drop Cisco OpenStack packages and use Ubuntu native repo instead
echo "coe::base::package_repo: ubuntu" >> data/hiera_data/user.common.yaml
sed -i 's,cisco_repo,ubuntu,' data/hiera_data/enable_ha/true.yaml
sed -i 's,cloud_archive,ubuntu,' data/hiera_data/common.yaml
sed -i 's,cisco_repo,ubuntu,' data/hiera_data/vendor/cisco_coi_common.yaml
sed -i "s/pocket: ''/pocket: '-proposed'/" data/hiera_data/vendor/cisco_coi_common.yaml
sed -i 's/icehouse main/icehouse-proposed main/g' install-scripts/cisco.install.sh
# check kvm-ok to decide qemu or kvm
can_we_kvm=`kvm-ok | grep NOT`
if [ -n "$can_we_kvm" ]
then
echo '# Disable KVM due to lack of HVM support' >> data/hiera_data/user.common.yaml
echo 'nova::compute::libvirt::libvirt_virt_type: qemu' >> data/hiera_data/user.common.yaml
fi
# go, go, go!
cd install-scripts
export scenario=all_in_one
./install.sh
# temp fixes / workarounds after install
#
# lots of ordering stuff to sort out still; run a few times to work around
puppet apply /etc/puppet/manifests/site.pp
puppet apply /etc/puppet/manifests/site.pp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment