Joe Topjian | 4b6ce84 | 2016-07-26 02:15:43 +0000 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | cd |
| 6 | sudo apt-get update |
| 7 | sudo apt-get install -y git make mercurial |
| 8 | |
| 9 | sudo wget -O /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme |
| 10 | sudo chmod +x /usr/local/bin/gimme |
| 11 | gimme 1.6 >> .bashrc |
| 12 | |
| 13 | mkdir ~/go |
| 14 | eval "$(/usr/local/bin/gimme 1.6)" |
| 15 | echo 'export GOPATH=$HOME/go' >> .bashrc |
| 16 | export GOPATH=$HOME/go |
| 17 | source .bashrc |
| 18 | |
| 19 | git clone https://git.openstack.org/openstack-dev/devstack -b stable/mitaka |
| 20 | cd devstack |
| 21 | cat >local.conf <<EOF |
| 22 | [[local|localrc]] |
| 23 | # OpenStack version |
| 24 | OPENSTACK_VERSION="mitaka" |
| 25 | |
| 26 | # devstack password |
| 27 | DEVSTACK_PASSWORD="password" |
| 28 | |
| 29 | # Configure passwords and the Swift Hash |
| 30 | MYSQL_PASSWORD=\$DEVSTACK_PASSWORD |
| 31 | RABBIT_PASSWORD=\$DEVSTACK_PASSWORD |
| 32 | SERVICE_TOKEN=\$DEVSTACK_PASSWORD |
| 33 | ADMIN_PASSWORD=\$DEVSTACK_PASSWORD |
| 34 | SERVICE_PASSWORD=\$DEVSTACK_PASSWORD |
| 35 | SWIFT_HASH=\$DEVSTACK_PASSWORD |
| 36 | |
| 37 | # Configure the stable OpenStack branches used by DevStack |
| 38 | # For stable branches see |
| 39 | # http://git.openstack.org/cgit/openstack-dev/devstack/refs/ |
| 40 | CINDER_BRANCH=stable/\$OPENSTACK_VERSION |
| 41 | CEILOMETER_BRANCH=stable/\$OPENSTACK_VERSION |
| 42 | GLANCE_BRANCH=stable/\$OPENSTACK_VERSION |
| 43 | HEAT_BRANCH=stable/\$OPENSTACK_VERSION |
| 44 | HORIZON_BRANCH=stable/\$OPENSTACK_VERSION |
| 45 | KEYSTONE_BRANCH=stable/\$OPENSTACK_VERSION |
| 46 | NEUTRON_BRANCH=stable/\$OPENSTACK_VERSION |
| 47 | NOVA_BRANCH=stable/\$OPENSTACK_VERSION |
| 48 | SWIFT_BRANCH=stable/\$OPENSTACK_VERSION |
| 49 | ZAQAR_BRANCH=stable/\$OPENSTACK_VERSION |
| 50 | |
| 51 | # Enable Swift |
| 52 | enable_service s-proxy |
| 53 | enable_service s-object |
| 54 | enable_service s-container |
| 55 | enable_service s-account |
| 56 | |
| 57 | # Disable Nova Network and enable Neutron |
| 58 | disable_service n-net |
| 59 | enable_service q-svc |
| 60 | enable_service q-agt |
| 61 | enable_service q-dhcp |
| 62 | enable_service q-l3 |
| 63 | enable_service q-meta |
| 64 | #enable_service q-flavors |
| 65 | |
| 66 | # Disable Neutron metering |
| 67 | disable_service q-metering |
| 68 | |
| 69 | # Enable LBaaS V1 |
| 70 | enable_service q-lbaas |
| 71 | |
| 72 | # Enable FWaaS |
| 73 | enable_service q-fwaas |
| 74 | |
| 75 | # Enable LBaaS v2 |
| 76 | #enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas stable/\$OPENSTACK_VERSION |
| 77 | #enable_plugin octavia https://git.openstack.org/openstack/octavia stable/\$OPENSTACK_VERSION |
| 78 | #enable_service q-lbaasv2 |
| 79 | #enable_service octavia |
| 80 | #enable_service o-cw |
| 81 | #enable_service o-hk |
| 82 | #enable_service o-hm |
| 83 | #enable_service o-api |
| 84 | |
| 85 | # Enable Trove |
| 86 | enable_plugin trove git://git.openstack.org/openstack/trove.git stable/\$OPENSTACK_VERSION |
| 87 | enable_service trove,tr-api,tr-tmgr,tr-cond |
| 88 | |
| 89 | # Disable Temptest |
| 90 | disable_service tempest |
| 91 | |
| 92 | # Disable Horizon |
| 93 | disable_service horizon |
| 94 | |
| 95 | # Disable Keystone v2 |
| 96 | #ENABLE_IDENTITY_V2=False |
| 97 | |
| 98 | # Enable SSL/tls |
| 99 | #enable_service tls-proxy |
| 100 | #USE_SSL=True |
| 101 | |
| 102 | # Enable Ceilometer |
| 103 | #enable_service ceilometer-acompute |
| 104 | #enable_service ceilometer-acentral |
| 105 | #enable_service ceilometer-anotification |
| 106 | #enable_service ceilometer-collector |
| 107 | #enable_service ceilometer-alarm-evaluator |
| 108 | #enable_service ceilometer-alarm-notifier |
| 109 | #enable_service ceilometer-api |
| 110 | |
| 111 | # Enable Zaqar |
| 112 | #enable_plugin zaqar https://github.com/openstack/zaqar |
| 113 | #enable_service zaqar-server |
| 114 | |
| 115 | # Automatically download and register a VM image that Heat can launch |
| 116 | # For more information on Heat and DevStack see |
| 117 | # http://docs.openstack.org/developer/heat/getting_started/on_devstack.html |
| 118 | #IMAGE_URLS+=",http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2" |
| 119 | #IMAGE_URLS+=",https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img" |
| 120 | |
| 121 | # Logging |
| 122 | LOGDAYS=1 |
| 123 | LOGFILE=/opt/stack/logs/stack.sh.log |
| 124 | LOGDIR=/opt/stack/logs |
| 125 | EOF |
| 126 | ./stack.sh |
| 127 | |
| 128 | # Patch openrc |
| 129 | #cat >> openrc <<EOF |
| 130 | # |
| 131 | # Currently, in order to use openstackclient with Identity API v3, |
| 132 | # we need to set the domain which the user and project belong to. |
| 133 | #if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then |
| 134 | # export OS_USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-"default"} |
| 135 | # export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"} |
| 136 | #fi |
| 137 | #EOF |
| 138 | |
| 139 | # Prep the testing environment by creating the required testing resources and environment variables |
| 140 | source openrc admin |
| 141 | wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img |
| 142 | glance image-create --name CirrOS --disk-format qcow2 --container-format bare < cirros-0.3.4-x86_64-disk.img |
| 143 | nova flavor-create m1.tform 99 512 5 1 --ephemeral 10 |
| 144 | _NETWORK_ID=$(nova net-list | grep private | awk -F\| '{print $2}' | tr -d ' ') |
| 145 | _EXTGW_ID=$(nova net-list | grep public | awk -F\| '{print $2}' | tr -d ' ') |
| 146 | _IMAGE_ID=$(nova image-list | grep CirrOS | awk -F\| '{print $2}' | tr -d ' ' | head -1) |
| 147 | echo export OS_IMAGE_NAME="cirros-0.3.4-x86_64-uec" >> openrc |
| 148 | echo export OS_IMAGE_ID="$_IMAGE_ID" >> openrc |
| 149 | echo export OS_NETWORK_ID=$_NETWORK_ID >> openrc |
| 150 | echo export OS_EXTGW_ID=$_EXTGW_ID >> openrc |
| 151 | echo export OS_POOL_NAME="public" >> openrc |
| 152 | echo export OS_FLAVOR_ID=99 >> openrc |
| 153 | source openrc demo |