This patch removes and/or renames anything that is Rackspace specific from the playbooks, roles and variables. It also removes items which appear to be orphaned/unused and flattens the playbooks into a single directory in order to better match ansible best practise (and remove some horrible fiddles we were doing). The following have been removed due to RAX/RPC naming or RAX/RPC specific usage: - playbooks/monitoring - playbooks/rax* - playbooks/rpc* - roles/maas* - roles/rax* - roles/rpc* - scripts/f5-* - scripts/maas* - scripts/rpc* - scripts/*lab* - vars/repo_packages/rackspace* - vars/repo_packages/rax* - vars/repo_packages/rpc* - vars/repo_packages/holland.yml The following have been removed as they are unused: - playbooks/setup/host-network-setup.yml - roles/openssl_pem_request - roles/host_interfaces - scripts/elsa* - ssh/ - vars/repo_packages/turbolift.yml The following directories have been renamed: - etc/rpc_deploy > etc/openstack_deploy - rpc_deployment > playbooks The playbooks have all been moved into a single directory: - rpc_deployment/playbooks/infrastructure/* > playbooks/ - rpc_deployment/playbooks/openstack/* > playbooks/ - rpc_deployment/playbooks/setup/* > playbooks/ The following files have been renamed: - lxc-rpc > lxc-openstack - lxc-rpc.conf > lxc-openstack.conf - rpc_environment > openstack_environment - rpc_release > openstack_release (etc and pip) - rpc_tempest_gate.sh > openstack_tempest_gate.sh - rpc_user_config > openstack_user_config The following variables have been renamed: - rpc_release > openstack_release - rpc_repo_url > openstack_repo_url The following variables have been introduced: - openstack_code_name: The code name of the upstream OpenStack release (eg: Juno) Notable variable/template value changes: - rabbit_cluster_name: rpc > openstack - wsrep_cluster_name: rpc_galera_cluster > openstack_galera_cluster DocImpact Closes-Bug: #1403676 Implements: blueprint rackspace-namesake Change-Id: Ib480fdad500b03c7cb90684aa444da9946ba8032
117 lines
4.8 KiB
Bash
Executable File
117 lines
4.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2014, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
## Shell Opts ----------------------------------------------------------------
|
|
|
|
set -e -u -v +x
|
|
|
|
## Variables -----------------------------------------------------------------
|
|
|
|
ADMIN_PASSWORD=${ADMIN_PASSWORD:-"secrete"}
|
|
BOOTSTRAP_ANSIBLE=${BOOTSTRAP_ANSIBLE:-"yes"}
|
|
BOOTSTRAP_AIO=${BOOTSTRAP_AIO:-"yes"}
|
|
DEPLOY_SWIFT=${DEPLOY_SWIFT:-"yes"}
|
|
DEPLOY_TEMPEST=${DEPLOY_TEMPEST:-"no"}
|
|
RUN_PLAYBOOKS=${RUN_PLAYBOOKS:-"yes"}
|
|
RUN_TEMPEST=${RUN_TEMPEST:-"no"}
|
|
CONFIG_PREFIX=${CONFIG_PREFIX:-"openstack"}
|
|
PLAYBOOK_DIRECTORY=${PLAYBOOK_DIRECTORY:-"playbooks"}
|
|
ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"--forks 10 -vvvv"}
|
|
|
|
## Functions -----------------------------------------------------------------
|
|
|
|
info_block "Checking for required libraries." || source $(dirname ${0})/scripts-library.sh
|
|
|
|
## Main ----------------------------------------------------------------------
|
|
|
|
# ensure that the current kernel can support vxlan
|
|
if ! modprobe vxlan; then
|
|
MINIMUM_KERNEL_VERSION=$(awk '/required_kernel/ {print $2}' ${PLAYBOOK_DIRECTORY}/inventory/group_vars/all.yml)
|
|
info_block "A minimum kernel version of ${MINIMUM_KERNEL_VERSION} is required for vxlan support."
|
|
exit 1
|
|
fi
|
|
|
|
# Get initial host information and reset verbosity
|
|
set +x && get_instance_info && set -x
|
|
|
|
# Bootstrap ansible if required
|
|
if [ "${BOOTSTRAP_ANSIBLE}" == "yes" ]; then
|
|
source $(dirname ${0})/bootstrap-ansible.sh
|
|
fi
|
|
|
|
# Bootstrap an AIO setup if required
|
|
if [ "${BOOTSTRAP_AIO}" == "yes" ]; then
|
|
source $(dirname ${0})/bootstrap-aio.sh
|
|
fi
|
|
|
|
# Get initial host information and reset verbosity
|
|
set +x && get_instance_info && set -x
|
|
|
|
# Install requirements
|
|
pip2 install -r requirements.txt || pip install -r requirements.txt
|
|
|
|
# Copy the base etc files
|
|
if [ ! -d "/etc/${CONFIG_PREFIX}_deploy" ];then
|
|
cp -R etc/${CONFIG_PREFIX}_deploy /etc/
|
|
|
|
# Generate the passwords
|
|
USER_VARS_PATH="/etc/${CONFIG_PREFIX}_deploy/user_variables.yml"
|
|
|
|
# Adjust any defaults to suit the AIO
|
|
# commented lines are removed by pw-token gen, so this substitution must
|
|
# happen prior.
|
|
sed -i "s/# nova_virt_type:.*/nova_virt_type: qemu/" ${USER_VARS_PATH}
|
|
|
|
# generate random passwords and tokens
|
|
./scripts/pw-token-gen.py --file ${USER_VARS_PATH}
|
|
|
|
# change the generated passwords for the OpenStack (admin) and Kibana (kibana) accounts
|
|
sed -i "s/keystone_auth_admin_password:.*/keystone_auth_admin_password: ${ADMIN_PASSWORD}/" ${USER_VARS_PATH}
|
|
sed -i "s/kibana_password:.*/kibana_password: ${ADMIN_PASSWORD}/" ${USER_VARS_PATH}
|
|
|
|
if [ "${DEPLOY_SWIFT}" == "yes" ]; then
|
|
# ensure that glance is configured to use swift
|
|
sed -i "s/glance_default_store:.*/glance_default_store: swift/" ${USER_VARS_PATH}
|
|
sed -i "s/glance_swift_store_auth_address:.*/glance_swift_store_auth_address: '{{ auth_identity_uri }}'/" ${USER_VARS_PATH}
|
|
sed -i "s/glance_swift_store_container:.*/glance_swift_store_container: glance_images/" ${USER_VARS_PATH}
|
|
sed -i "s/glance_swift_store_key:.*/glance_swift_store_key: '{{ glance_service_password }}'/" ${USER_VARS_PATH}
|
|
sed -i "s/glance_swift_store_region:.*/glance_swift_store_region: RegionOne/" ${USER_VARS_PATH}
|
|
sed -i "s/glance_swift_store_user:.*/glance_swift_store_user: 'service:glance'/" ${USER_VARS_PATH}
|
|
fi
|
|
|
|
if [ "${BOOTSTRAP_AIO}" == "yes" ]; then
|
|
# adjust the default user configuration for the AIO
|
|
USER_CONFIG_PATH="/etc/${CONFIG_PREFIX}_deploy/${CONFIG_PREFIX}_user_config.yml"
|
|
ENV_CONFIG_PATH="/etc/${CONFIG_PREFIX}_deploy/${CONFIG_PREFIX}_environment.yml"
|
|
sed -i "s/environment_version: .*/environment_version: $(md5sum ${ENV_CONFIG_PATH} | awk '{print $1}')/" ${USER_CONFIG_PATH}
|
|
SERVER_IP_ADDRESS="$(ip -o -4 addr show dev eth0 | awk -F '[ /]+' '/global/ {print $4}')"
|
|
sed -i "s/external_lb_vip_address: .*/external_lb_vip_address: ${SERVER_IP_ADDRESS}/" ${USER_CONFIG_PATH}
|
|
if [ "${DEPLOY_SWIFT}" == "yes" ]; then
|
|
# add the swift proxy host network provider map
|
|
sed -i 's/# - swift_proxy/- swift_proxy/' ${USER_CONFIG_PATH}
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
# Run the ansible playbooks if required
|
|
if [ "${RUN_PLAYBOOKS}" == "yes" ]; then
|
|
source $(dirname ${0})/run-playbooks.sh
|
|
fi
|
|
|
|
# Run the tempest tests if required
|
|
if [ "${RUN_TEMPEST}" == "yes" ]; then
|
|
source $(dirname ${0})/run-tempest.sh
|
|
fi
|