set up quickstart to replace instack-virt-setup

Implements: Replace instack-virt-setup with a new tool
(tripleo-quickstart)

Closes-Bug: #1604518
Closes-Bug: #1604520

Change-Id: I0d29c67e88b7d493e4c8815d5c8fb7333dc0d897
This commit is contained in:
Wesley Hayutin 2016-08-19 15:38:53 -04:00 committed by Wes Hayutin
parent 3d97f60654
commit 98e19578b9
37 changed files with 117 additions and 763 deletions

View File

@ -34,7 +34,7 @@ bash quickstart.sh \
--ansible-debug \
--bootstrap \
--working-dir $WORKSPACE/ \
--requirements quickstart-role-requirements.txt \
--requirements quickstart-extras-requirements.txt \
--requirements $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/requirements_files/$REQUIREMENTS_FILE \
--release $RELEASE \
--extra-vars prefix=$PREFIX \

View File

@ -23,7 +23,7 @@ bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
--no-clone \
--bootstrap \
--retain-inventory \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--config $WORKSPACE/config/general_config/$CONFIG.yml \
--playbook collect-logs.yml \
--extra-vars @$WORKSPACE/config/general_config/centosci-logs.yml \

View File

@ -24,6 +24,7 @@ bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
--extra-vars @$WORKSPACE/config/general_config/devmode.yml \
--release "${RELEASE}-tripleo" \
--extra-vars test_ping=False \
--playbook quickstart-extras.yml \
$VIRTHOST
bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
@ -32,10 +33,11 @@ bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
--no-clone \
--bootstrap \
--retain-inventory \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--playbook tempest.yml \
--extra-vars tempest_source=rdo \
--extra-vars tempest_format=venv \
--playbook quickstart-extras.yml \
$VIRTHOST
popd

View File

@ -35,7 +35,7 @@ bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
--working-dir $WORKSPACE/ \
--bootstrap \
--no-clone \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
-e deploy_timeout=75 \
--config $WORKSPACE/config/general_config/$CONFIG.yml \
--tags all \

View File

@ -30,7 +30,7 @@ bash quickstart.sh \
--tags all \
--no-clone \
--teardown all \
--requirements quickstart-role-requirements.txt \
--requirements quickstart-extras-requirements.txt \
--requirements $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/requirements_files/$REQUIREMENTS_FILE \
--config $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/config_files/$CONFIG_FILE \
--extra-vars @$WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/env_settings.yml \

View File

@ -33,7 +33,7 @@ bash quickstart.sh \
--working-dir $WORKSPACE/ \
--tags all \
--no-clone \
--requirements quickstart-role-requirements.txt \
--requirements quickstart-extras-requirements.txt \
--requirements $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/requirements_files/$REQUIREMENTS_FILE \
--config $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/config_files/$CONFIG_FILE \
--extra-vars @$OVB_SETTINGS_FILE \

View File

@ -33,5 +33,8 @@ bash quickstart.sh \
--working-dir $WORKSPACE/ \
--no-clone \
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
--bootstrap \
--requirements quickstart-extras-requirements.txt \
--playbook quickstart-extras.yml \
$VIRTHOST
popd

View File

@ -25,7 +25,7 @@ bash quickstart.sh \
--ansible-debug \
--bootstrap \
--working-dir $WORKSPACE/ \
--requirements quickstart-role-requirements.txt \
--requirements quickstart-extras-requirements.txt \
--requirements $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/requirements_files/$REQUIREMENTS_FILE \
--release $RELEASE \
--extra-vars @$OVB_CREDS_FILE \

View File

@ -34,7 +34,7 @@ if [ "$JOB_TYPE" = "gate" ]; then
--working-dir $WORKSPACE/ \
--no-clone \
--bootstrap \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--playbook gate-roles.yml \
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
$VIRTHOST
@ -44,7 +44,7 @@ if [ "$JOB_TYPE" = "gate" ]; then
--working-dir $WORKSPACE/ \
--no-clone \
--bootstrap \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--playbook gate-roles.yml \
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
$VIRTHOST
@ -57,7 +57,7 @@ if [ "$JOB_TYPE" = "dlrn-gate" ] || [ "$JOB_TYPE" = "dlrn-gate-testing" ]; then
--no-clone \
--bootstrap \
--extra-vars artg_compressed_gating_repo="/home/stack/gating_repo.tar.gz" \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--playbook dlrn-gate.yml \
--tags all \
--teardown all \
@ -70,8 +70,8 @@ if [ "$JOB_TYPE" = "dlrn-gate" ] || [ "$JOB_TYPE" = "dlrn-gate-testing" ]; then
--retain-inventory \
--extra-vars compressed_gating_repo="/home/stack/gating_repo.tar.gz" \
--config $WORKSPACE/config/general_config/$CONFIG.yml \
--playbook tripleo-roles.yml \
--skip-tags provision,undercloud-post-install \
--playbook quickstart-extras.yml \
--skip-tags provision \
--tags all \
--teardown none \
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
@ -82,10 +82,9 @@ else
--working-dir $WORKSPACE/ \
--no-clone \
--bootstrap \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-role-requirements.txt \
--requirements $WORKSPACE/tripleo-quickstart/quickstart-extras-requirements.txt \
--config $WORKSPACE/config/general_config/$CONFIG.yml \
--playbook tripleo-roles.yml \
--skip-tags undercloud-post-install \
--playbook quickstart-extras.yml \
--tags all \
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
$VIRTHOST

View File

@ -0,0 +1,71 @@
# This is the playbook used by the `quickstart.sh` script.
- include: quickstart.yml
# Prepare any additional configuration files required by the overcloud
- name: Prepare configuration files for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-config
# Prepare the overcloud images for deployment
- name: Prepare the overcloud images for deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-images
# Prepare the overcloud flavor configuration
- name: Prepare overcloud flavors
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-flavors
# Prepare the undercloud networks for the overcloud deployment
- name: Prepare the undercloud networks for the overcloud deployment
hosts: undercloud
gather_facts: no
roles:
- overcloud-prep-network
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: no
roles:
- tripleo-overcloud
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
vars:
inventory: all
roles:
- tripleo-inventory
# Check the results of the deployment, note after inventory has executed
- name: Check the result of the deployment
hosts: localhost
tags:
- overcloud-deploy
tasks:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
# Validate the deployment
- name: validate the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- tripleo-overcloud-validate

View File

@ -53,48 +53,8 @@
- tripleo-inventory
# Deploy the undercloud
- name: Install undercloud and deploy overcloud
- name: Install undercloud
hosts: undercloud
gather_facts: no
roles:
- tripleo/undercloud
# Deploy the overcloud
- name: Deploy the overcloud
hosts: undercloud
gather_facts: no
roles:
- tripleo/overcloud
- name: Add the overcloud nodes to the generated inventory
hosts: undercloud
gather_facts: yes
tags:
- overcloud-deploy
vars:
inventory: all
roles:
- tripleo-inventory
# Check the results of the deployment, note after inventory has executed
- name: Check the result of the deployment
hosts: localhost
tags:
- overcloud-deploy
tasks:
- name: ensure the deployment result has been read into memory
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
# overcloud_deploy_result = ["failed", "passed"]
- name: did the deployment pass or fail?
debug: var=overcloud_deploy_result
failed_when: overcloud_deploy_result == "failed"
# Validate the deployment
- name: validate the overcloud
hosts: undercloud
tags:
- overcloud-validate
gather_facts: no
roles:
- tripleo/validate

View File

@ -0,0 +1,23 @@
# Roles
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-prep-config.git/#egg=ansible-role-tripleo-overcloud-prep-config
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-prep-flavors.git/#egg=ansible-role-tripleo-overcloud-prep-flavors
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-prep-images.git/#egg=ansible-role-tripleo-overcloud-prep-images
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-prep-network.git/#egg=ansible-role-tripleo-overcloud-prep-network
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud.git/#egg=ansible-role-tripleo-overcloud
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-validate.git/#egg=ansible-role-tripleo-overcloud-validate
git+https://github.com/redhat-openstack/ansible-role-tripleo-cleanup-nfo.git/#egg=ansible-role-tripleo-cleanup-nfo
git+https://github.com/redhat-openstack/ansible-role-tripleo-collect-logs.git/#egg=ansible-role-tripleo-collect-logs
git+https://github.com/redhat-openstack/ansible-role-tripleo-gate.git#egg=ansible-role-tripleo-gate
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-upgrade.git#egg=ansible-role-tripleo-overcloud-upgrade
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-scale-nodes.git#egg=ansible-role-tripleo-overcloud-scale-nodes
git+https://github.com/redhat-openstack/ansible-role-tripleo-tempest.git#egg=ansible-role-tripleo-tempest
git+https://github.com/redhat-openstack/ansible-role-tripleo-baremetal-prep-virthost.git#egg=ansible-role-tripleo-baremetal-prep-virthost
git+https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-prep-baremetal.git#egg=ansible-role-tripleo-overcloud-prep-baremetal
git+https://github.com/redhat-openstack/ansible-role-tripleo-provision-heat.git#egg=ansible-role-tripleo-provision-heat
git+https://github.com/redhat-openstack/ansible-role-tripleo-validate-ipmi.git#egg=ansible-role-tripleo-validate-ipmi
# To pull in local development changes
#file:///<dir>/ansible-role-foo/#egg=ansible-role-foo

View File

@ -432,16 +432,9 @@ Access the undercloud by:
ssh -F $OPT_WORKDIR/ssh.config.ansible undercloud
There are scripts in the home directory to continue the deploy:
Follow the documentation in the link below to complete your deployment.
overcloud-deploy.sh will deploy the overcloud
overcloud-deploy-post.sh will do any post-deploy configuration
overcloud-validate.sh will run post-deploy validation
Alternatively, you can ignore these scripts and follow the upstream docs,
starting from the overcloud deploy section:
http://ow.ly/1Vc1301iBlb
http://ow.ly/c44w304begR
##################################
Virtual Environment Setup Complete

View File

@ -1,73 +0,0 @@
# Script and log locations used during the deploy process.
deploy_script: overcloud-deploy.sh.j2
deploy_log: "{{ working_dir }}/overcloud_deploy.log"
post_deploy_script: overcloud-deploy-post.sh.j2
post_deploy_log: "{{ working_dir }}/overcloud_deploy_post.log"
validate_script: overcloud-validate.sh.j2
# `floating_ip_cidr` controls the address range used in the network
# created for tempest tests. We use Ansible's [ipaddr][] filter to
# calculate addresses within this range so that you can provide a
# different value for `floating_ip_cidr` and in many cases not need to
# change any of the related variables.
#
# [ipaddr]: http://docs.ansible.com/ansible/playbooks_filters_ipaddr.html
floating_ip_cidr: "{{ undercloud_network_cidr|default('192.0.2.0/24') }}"
floating_ip_start: "{{ floating_ip_cidr|nthhost(100) }}"
floating_ip_end: "{{ floating_ip_cidr|nthhost(120) }}"
external_network_gateway: "{{ floating_ip_cidr|nthhost(1) }}"
# Minutes to wait before giving up on the deploy.
deploy_timeout: 90
extra_args: ""
libvirt_args: "--libvirt-type qemu"
# we generally assume that the argument to --control-flavor will
# always be the `oooq_control` that we create from the flavors: key.
# If the deployer needs to use a different name, she can configure a
# `flavor_map` key that will map overcloud roles to specific flavor
# names, like:
#
# flavor_map:
# control: my_special_control_flavor
#
# This is to avoid having to replace the flavor_args key wholesale for
# a single change.
#
flavor_args: >-
--control-flavor {{flavor_map.control
if flavor_map is defined and 'control' in flavor_map else 'oooq_control'}}
--compute-flavor {{flavor_map.compute
if flavor_map is defined and 'compute' in flavor_map else 'oooq_compute'}}
--ceph-storage-flavor {{flavor_map.ceph
if flavor_map is defined and 'ceph' in flavor_map else 'oooq_ceph'}}
timeout_args: "--timeout {{deploy_timeout}}"
network_args: ""
pacemaker_args: ""
deploy_args: >-
{{ libvirt_args }}
{{ flavor_args }}
{{ timeout_args }}
{{ network_args }}
{{ pacemaker_args }}
{{ extra_args }}
step_deploy_overcloud: true
step_validate_overcloud: true
prepare_tempest: false
# If `test_tempest` is `true`, run tempests tests, otherwise do not
# run them.
test_tempest: false
tempest_regex: ".*smoke"
tempest_workers: 2
# If `test_ping` is `true`, run a simple ping test to validate the
# overcloud.
test_ping: true
# Path to tripleo-heat-templates
overcloud_templates_path: /usr/share/openstack-tripleo-heat-templates

View File

@ -1,2 +0,0 @@
dependencies:
- tripleo

View File

@ -1,32 +0,0 @@
# Generate a number of scripts from templates. These are scripts
# rather than additional ansible tasks so that they can be run
# manually from the undercloud host.
- name: Create overcloud deploy script
template:
src: "{{ deploy_script }}"
dest: "{{ working_dir }}/overcloud-deploy.sh"
mode: 0755
- name: Create overcloud validate script
template:
src: "{{ validate_script }}"
dest: "{{ working_dir }}/overcloud-validate.sh"
mode: 0755
- name: Create tempest skipfile
template:
src: skipfile.j2
dest: "{{ working_dir }}/skipfile"
mode: 0644
- name: Create tempest run script
template:
src: run-tempest.sh.j2
dest: "{{ working_dir }}/run-tempest.sh"
mode: 0755
- name: Create post-deploy script
template:
src: "{{ post_deploy_script }}"
dest: "{{ working_dir }}/overcloud-deploy-post.sh"
mode: 0755

View File

@ -1,4 +0,0 @@
- name: Deploy the overcloud
shell: |
{{ working_dir }}/overcloud-deploy.sh > {{ deploy_log }} 2>&1
when: step_deploy_overcloud

View File

@ -1,20 +0,0 @@
- include: pre-deploy.yml
tags:
- overcloud-scripts
- include: create-scripts.yml
tags:
- overcloud-scripts
- include: deploy-overcloud.yml
tags:
- overcloud-deploy
- include: overcloud-status.yml
tags:
- overcloud-deploy
- include: post-deploy.yml
tags:
- overcloud-post-deploy
when: overcloud_deploy_result == "passed"

View File

@ -1,36 +0,0 @@
---
# The overlcoud deployment has been known at times to not provide an
# accurate error code.
# If we don't get a useful error code from the previous script, so check
# the log for a CREATE_FAILED message.
# use ! to invert the error code so 1 = fail, 0 = pass
# don't use -q to allow stdout to be visible.
# Other option to consider vs. grep
#/usr/bin/awk '/Stack overcloud CREATE_/ && /FAILED/{exit 1}' {{ deploy_log }}
- name: Check overcloud deploy status
shell: >
! /usr/bin/grep 'Stack overcloud CREATE_FAILED' {{ deploy_log }}
register: deploy_result
ignore_errors: true
- name: write out overcloud status to a file on the localhost
shell: >
echo '{ "overcloud_deploy_result": "failed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json"
delegate_to: localhost
when: deploy_result.rc != 0
- name: write out overcloud status to a file on the localhost
shell: >
echo '{ "overcloud_deploy_result": "passed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json"
delegate_to: localhost
when: deploy_result.rc == 0
- name: import deployment status from file
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
- name: echo deployment_status
debug: var=overcloud_deploy_result

View File

@ -1,15 +0,0 @@
# This makes the overcloudrc file available locally. This file
# contains credentials for accessing OpenStack API services on the
# overcloud.
- name: Copy overcloudrc to ansible host
fetch:
flat: true
src: overcloudrc
dest: "{{ local_working_dir }}/overcloudrc"
- name: Run post-deploy script
shell: |
{{ working_dir }}/overcloud-deploy-post.sh \
> {{ post_deploy_log }} 2>&1
- include: updatessh.yml

View File

@ -1,13 +0,0 @@
- name: set network_args fact
set_fact:
network_args: >-
-e {{overcloud_templates_path}}/environments/network-isolation.yaml
-e {{overcloud_templates_path}}/environments/net-single-nic-with-vlans.yaml
-e $HOME/network-environment.yaml
when: network_isolation
- name: enable pacemaker
set_fact:
pacemaker_args: >-
-e {{overcloud_templates_path}}/environments/puppet-pacemaker.yaml
when: enable_pacemaker

View File

@ -1,34 +0,0 @@
# Update the ssh configuration on the undercloud to provide convenient
# access to the overcloud hosts. Creates an entry in `.ssh/config`
# for each overcloud hosts that will:
#
# - Ensure we connect as the `heat-admin` user
# - Avoid ssh hostkey checks, which can be a pain in rapidly changing
# development environments.
- name: Get list of overcloud servers
shell: |
. {{ working_dir }}/stackrc
openstack server list -f json
register: overcloud_servers_cmd
- name: Set overcloud_servers fact
set_fact:
overcloud_servers: "{{ overcloud_servers_cmd.stdout }}"
- name: Ensure .ssh directory exists
file:
path: .ssh
state: directory
mode: "0700"
- name: Add ssh config for accessing overcloud servers
blockinfile:
dest: .ssh/config
create: true
mode: "0600"
block: |
Host {{ overcloud_servers | map(attribute='Name') | join(' ') }}
User heat-admin
StrictHostkeyChecking no
UserKnownHostsFile /dev/null

View File

@ -1,70 +0,0 @@
## Prepare tempest
## ---------------
## * Source in the overcloud credentials.
## ::
source {{ working_dir }}/overcloudrc
## * Clean up the "nova" network if it exists from a previous run.
## ::
neutron net-delete nova > /dev/null 2>&1 || true
## * Create a network named "nova" for use when running tempest.
## ::
neutron net-create nova --router:external=True \
--provider:network_type flat \
--provider:physical_network datacentre
public_net_id=$(neutron net-show nova -f value -c id)
neutron subnet-create --name ext-subnet \
--allocation-pool \
start={{ floating_ip_start }},end={{ floating_ip_end }} \
--disable-dhcp \
--gateway {{ external_network_gateway }} \
nova {{ floating_ip_cidr }}
## * Clean up from any previous tempest run.
## ::
rm -rf {{ working_dir }}/tempest
mkdir {{ working_dir }}/tempest
cd {{ working_dir }}/tempest
## .. note:: Workaround: clone missing packages: https://bugzilla.redhat.com/show_bug.cgi?id=1333884
## when using that venv install, we need requirements.txt and test-requirements.txt
## as package does not provide it, curl from the origin and set on the right directory
## before venv install.
## ::
curl https://raw.githubusercontent.com/redhat-openstack/tempest/master/requirements.txt -o requirements.txt
curl https://raw.githubusercontent.com/redhat-openstack/tempest/master/test-requirements.txt -o test-requirements.txt
## * Generate a tempest configuration.
## ::
sudo yum install -y libffi-devel openssl-devel python-virtualenv
/usr/share/openstack-tempest-*/tools/configure-tempest-directory
# TODO (sshnaidm): to move for packages when bug will be fixed:
# https://bugzilla.redhat.com/show_bug.cgi?id=1333884
python ./tools/install_venv.py
./tools/with_venv.sh pip install junitxml httplib2
./tools/with_venv.sh ./tools/config_tempest.py --out etc/tempest.conf \
--network-id $public_net_id \
--deployer-input ~/tempest-deployer-input.conf \
--debug --create \
identity.uri $OS_AUTH_URL \
identity.admin_password $OS_PASSWORD \
network.tenant_network_cidr 192.168.0.0/24 \
object-storage.operator_role swiftoperator \
compute.allow_tenant_isolation true \
compute.build_timeout 500 \
compute.image_ssh_user cirros \
compute.ssh_user cirros \
network.build_timeout 500 \
volume.build_timeout 500 \
scenario.ssh_user cirros \
orchestration.stack_owner_role heat_stack_owner

View File

@ -1,47 +0,0 @@
#!/bin/sh
set -eux
### --start_docs
## Post overcloud deployment steps
## ===============================
## * Prepare Your Environment.
## ::
HOSTFILE=/etc/hosts
## * Source in the undercloud credentials.
## ::
. {{ working_dir }}/stackrc
## * Remove any old overcloud host entries from `/etc/hosts`.
## ::
sudo sed -i '/^## BEGIN OVERCLOUD HOSTS/,/^## END OVERCLOUD HOSTS/ d' $HOSTFILE
## * Add overcloud hosts to `/etc/hosts`.
## ::
cat <<EOF | sudo tee -a $HOSTFILE
## BEGIN OVERCLOUD HOSTS #nodocs
$(heat output-show -F raw overcloud HostsEntry)
$(heat output-show -F raw overcloud PublicVip) overcloud-public-vip
## END OVERCLOUD HOSTS #nodocs
EOF
## * Source in the overcloud credentials.
## ::
. {{ working_dir }}/overcloudrc
## * Create the `heat_stack_owner` role if it doesn't already exist.
## ::
if ! openstack role show heat_stack_owner > /dev/null 2>&1; then
openstack role create heat_stack_owner
openstack role add --project admin --user admin heat_stack_owner
fi
### --stop_docs

View File

@ -1,94 +0,0 @@
#!/bin/bash
set -eux
### --start_docs
## Deploying the overcloud
## =======================
## Prepare Your Environment
## ------------------------
## * Source in the undercloud credentials.
## ::
source {{ working_dir }}/stackrc
### --stop_docs
# Wait until there are hypervisors available.
while true; do
count=$(openstack hypervisor stats show -c count -f value)
if [ $count -gt 0 ]; then
break
fi
done
### --start_docs
{% if test_ping %}
## * Include configuration necessary for the ping test here if requested via the
## ansible `test_ping` variable.
## ::
DEPLOY_ENV_YAML=/tmp/deploy_env.yaml
## * Set most service workers to 1 to minimise memory usage on
## the deployed overcloud when using the pingtest. We use this
## test over tempest when we are memory constrained, ie the HA jobs.
## ::
cat > $DEPLOY_ENV_YAML << EOENV
parameter_defaults:
controllerExtraConfig:
{% if release in ['mitaka','liberty'] %}
# In releases before Mitaka, HeatWorkers doesn't modify
# num_engine_workers, so handle via heat::config
heat::config::heat_config:
DEFAULT/num_engine_workers:
value: 1
{% endif %}
heat::api_cloudwatch::enabled: false
heat::api_cfn::enabled: false
HeatWorkers: 1
CeilometerWorkers: 1
CinderWorkers: 1
GlanceWorkers: 1
KeystoneWorkers: 1
NeutronWorkers: 1
NovaWorkers: 1
SwiftWorkers: 1
EOENV
{% endif %}
## * Deploy the overcloud!
## ::
openstack overcloud deploy \
--templates {{overcloud_templates_path}} \
{{ deploy_args }} \
${DEPLOY_ENV_YAML:+-e $DEPLOY_ENV_YAML} "$@" || true
### --stop_docs
# We don't always get a useful error code from the openstack deploy command,
# so check `heat stack-list` for a CREATE_FAILED status.
if heat stack-list | grep -q 'CREATE_FAILED'; then
# get the failures list
openstack stack failures list overcloud > failed_deployment_list.log || true
# get any puppet related errors
for failed in $(heat resource-list \
--nested-depth 5 overcloud | grep FAILED |
grep 'StructuredDeployment ' | cut -d '|' -f3)
do
echo "heat deployment-show out put for deployment: $failed" >> failed_deployments.log
echo "######################################################" >> failed_deployments.log
heat deployment-show $failed >> failed_deployments.log
echo "######################################################" >> failed_deployments.log
echo "puppet standard error for deployment: $failed" >> failed_deployments.log
echo "######################################################" >> failed_deployments.log
# the sed part removes color codes from the text
heat deployment-show $failed |
jq -r .output_values.deploy_stderr |
sed -r "s:\x1B\[[0-9;]*[mK]::g" >> failed_deployments.log
echo "######################################################" >> failed_deployments.log
done
fi

View File

@ -1,42 +0,0 @@
#!/bin/bash
set -eux
### --start_docs
## Validate the overcloud deployment
## =================================
## Prepare Test Environment
## ------------------------
## * Translate some ansible variables into shell variables.
## (trown) the new lines in between these are needed so that
## after templating they variable assignments are on separate lines.
## ::
TEST_PING={% if test_ping|bool %}1{% else %}0{% endif %}
PREPARE_TEMPEST={% if prepare_tempest|bool %}1{% else %}0{% endif %}
TEST_TEMPEST={% if test_tempest|bool %}1{% else %}0{% endif %}
# Run the appropriate chunk of code if the corresponding variable was set. #nodocs
if [ ${TEST_PING} == "1" ]; then #nodocs
{% include 'tripleo-pingtest.sh.j2' %}
fi #nodocs
if [[ ${PREPARE_TEMPEST} == "1" || ${TEST_TEMPEST} == "1" ]]; then #nodocs
{% include 'configure-tempest.sh.j2' %}
fi #nodocs
if [ ${TEST_TEMPEST} == "1" ]; then #nodocs
{% include 'run-tempest.sh.j2' %}
fi #nodocs
### --stop_docs

View File

@ -1,7 +0,0 @@
## Run tempest tests
## -----------------
## ::
./tools/with_venv.sh ./tools/run-tests.sh {{tempest_regex}} --concurrency {{ tempest_workers }} --skip-file {{ working_dir }}/skipfile 2>&1 > ~/tempest_console.log && exitval=0 || exitval=$?
subunit2html $(find ~/tempest/.testrepository -name [0-9] | head -1) ~/tempest.html >> ~/tempest_console.log ||:
exit ${exitval}

View File

@ -1,11 +0,0 @@
# rhbz1304933
-tempest.api.telemetry.test_telemetry_notification_api
# old bug rhbz1272289
-tempest.scenario.test_volume_boot_pattern
-tempest.api.volume.test_volumes_get
# rhbz1266947
-tempest.api.identity.*v3
# rhbz1357667
-tempest.api.data_processing
# lpbug 1605654
-tempest.scenario.test_network_basic_ops.TestNetworkBasicOps

View File

@ -1,42 +0,0 @@
## Ping test
## ---------
## ::
PINGTEST_TEMPLATE=tenantvm_floatingip
EXTERNAL_NETWORK_GATEWAY={{ external_network_gateway }}
FLOATING_IP_CIDR={{ floating_ip_cidr }}
FLOATING_IP_START={{ floating_ip_start }}
FLOATING_IP_END={{ floating_ip_end }}
export PINGTEST_TEMPLATE
export EXTERNAL_NETWORK_GATEWAY FLOATING_IP_CIDR
export FLOATING_IP_START FLOATING_IP_END
## * Clean up network if it exists from previous run.
## ::
source {{ working_dir }}/overcloudrc
neutron net-delete nova > /dev/null 2>&1 || true
## Clean up test images.
## ::
glance image-list |
awk '/pingtest_image/ {print $2}' |
xargs --no-run-if-empty -n1 glance image-delete
rm -rf tripleo-ci
git clone https://github.com/openstack-infra/tripleo-ci.git
pushd tripleo-ci
## .. note:: We set STABLE_RELEASE unconditionally here, since it
## will not break anything, but gets us the correct behavior
## for liberty. Once we have https://review.openstack.org/#/c/308545/
## we can change this to be release specific.
## ::
STABLE_RELEASE=liberty
## * Execute the ping test
## ::
./scripts/tripleo.sh --overcloud-pingtest

View File

@ -17,9 +17,3 @@
src: "{{ undercloud_install_script }}"
dest: "{{ working_dir }}/undercloud-install.sh"
mode: 0755
- name: Create undercloud post-install script
template:
src: "{{ undercloud_post_install_script }}"
dest: "{{ working_dir }}/undercloud-post-install.sh"
mode: 0755

View File

@ -34,3 +34,4 @@
- include: post-install.yml
tags:
- undercloud-post-install

View File

@ -24,16 +24,3 @@
line: "export OS_PASSWORD={{ undercloud_admin_password.stdout }}"
regexp: "OS_PASSWORD"
- name: Prepare the undercloud for deploy
shell: |
{{ working_dir }}/undercloud-post-install.sh > \
{{ undercloud_post_install_log }} 2>&1
- name: Create network environment file for network isolation
tags:
- undercloud-scripts
template:
src: "{{ network_environment_file }}"
dest: "{{ working_dir }}/network-environment.yaml"
mode: 0755
when: network_isolation

View File

@ -1,8 +0,0 @@
{#
This takes advantage of the fact that valid JSON is also
valid YAML. The default to_nice_yaml filter doesn't quote strings,
which can cause unexpected implicit type conversion when the
resulting YAML is consumed, whereas with JSON all strings are quoted.
#}
{% set parameter_defaults = {'parameter_defaults': network_environment_args} %}
{{ parameter_defaults|to_nice_json }}

View File

@ -1,121 +0,0 @@
#!/bin/bash
set -eux
### --start_docs
## Prepare the undercloud for deploying the overcloud
## ==================================================
## Prepare Your Environment
## ------------------------
## * Source in the undercloud credentials.
## ::
source {{ working_dir }}/stackrc
## * Upload images to glance.
## ::
openstack overcloud image upload {% if bash_deploy_ramdisk %}--old-deploy-image{% endif %}
## * Register nodes with Ironic.
## ::
openstack baremetal import --json instackenv.json
openstack baremetal configure boot
{% if step_introspect %}
## * Introspect hardware attributes of nodes.
## ::
openstack baremetal introspection bulk start
{% endif %}
## Flavor Details
## --------------
## * Create flavor oooq_<name> for each flavor in the ansible `flavors` variable.
{% for name, flavor in (flavors|default({})).items() if name != 'undercloud' %}
## * Remove flavor before attempting to create.
## ::
nova flavor-delete oooq_{{ name }} > /dev/null 2>&1 || true
## * We subtract 1 from the total disk size here to resolve problems
## encountered in CI in which the available disk space on the virtual
## nodes was slightly less than what we requested.
## ::
openstack flavor create --id auto \
--ram {{flavor.memory}} \
--disk $(( {{flavor.disk}} - 1)) \
--vcpus {{flavor.vcpu}} \
oooq_{{ name }}
openstack flavor set \
--property "cpu_arch"="x86_64" \
--property "capabilities:boot_option"="local" \
--property "capabilities:profile"="{{ name }}" oooq_{{ name }}
{% for propname,propval in (flavor.properties|default({})).items() %}
openstack flavor set --property "{{propname}}={{propval}}" oooq_{{ name }}
{% endfor %}
{% endfor %}
{% if network_isolation == true and ipv6 == false %}
## Setup Networking
## ---------------
## * Enable NAT for "external" network.
## ::
RULE="-s {{undercloud_external_network_cidr}} ! -d {{undercloud_external_network_cidr}} -j MASQUERADE"
if ! sudo iptables -t nat -C BOOTSTACK_MASQ $RULE; then
sudo iptables -t nat -A BOOTSTACK_MASQ $RULE
sudo sh -c 'iptables-save > /etc/sysconfig/iptables'
fi
{% for name, network in (undercloud_networks|default({})).items() if name == 'external' %}
sudo bash -c 'cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-vlan{{ network.tag }}
DEVICE=vlan{{ network.tag }}
ONBOOT=yes
DEVICETYPE={{ network.device_type }}
TYPE={{ network.type }}
BOOTPROTO=static
IPADDR={{ network.address }}
NETMASK={{ network.netmask }}
OVS_BRIDGE={{ network.ovs_bridge }}
OVS_OPTIONS={{ network.ovs_options }}
EOF'
sudo ifup ifcfg-vlan{{ network.tag }}
{% endfor %}
{%endif%}
{% if overcloud_templates_repo is defined and overcloud_templates_path is defined %}
## * Clone the t-h-t templates if needed.
## ::
rm -rf {{ overcloud_templates_path }}
git clone {% if overcloud_templates_branch is defined %}-b {{ overcloud_templates_branch }} \
--single-branch{% endif %} {{ overcloud_templates_repo }} {{ overcloud_templates_path }}
{% if overcloud_templates_refspec is defined %}
## * Checkout an open t-h-t review if specified
## (this will stomp on the overcloud_templates_branch, so only one should be used).
## ::
pushd {{overcloud_templates_path}}
git fetch {{ overcloud_templates_repo }} {{ overcloud_templates_refspec }} && git checkout FETCH_HEAD
popd
{% endif %}
{% endif %}
### --stop_docs

View File

@ -1,2 +0,0 @@
working_dir: /home/stack
validate_log: "{{ working_dir }}/overcloud_validate.log"

View File

@ -1,3 +0,0 @@
- include: validate.yml
tags:
- overcloud-validate

View File

@ -1,3 +0,0 @@
- name: Validate the overcloud
shell: |
{{ working_dir }}/overcloud-validate.sh > {{ validate_log }} 2>&1