move most things out from the playbooks dir, and use config for release info

* move the roles, libraries and config to a top level dir
* adjust the ansible.cfg to account for the new role path
* create a config directory
  config/release  <- only for release and image_url info
  config/general_config <- everything else
* update collect-logs role path
* add ci-scripts/full-minimal.sh so that jjb will not have
to be updated after this.

Change-Id: I2e6129553bca253fa47ce56bfcbc2f244e74409e
This commit is contained in:
Wesley Hayutin 2016-05-05 15:00:32 -04:00 committed by John Trowbridge
parent 7c7fbcdaf7
commit 6926a86c30
93 changed files with 34 additions and 29 deletions

View File

@ -6,9 +6,9 @@ host_key_checking = False
force_color = 1
# Attempt to load custom modules whether it's installed system-wide or from a virtual environment
test_plugins = /usr/lib/python2.7/site-packages/tripleo-quickstart/playbooks/test_plugins:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/playbooks/test_plugins:playbooks/test_plugins
library = /usr/lib/python2.7/site-packages/tripleo-quickstart/playbooks/library:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/playbooks/library:playbooks/library
roles_path = playbooks/roles:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/playbooks/roles
test_plugins = /usr/lib/python2.7/site-packages/tripleo-quickstart/test_plugins:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/test_plugins:test_plugins
library = /usr/lib/python2.7/site-packages/tripleo-quickstart/library:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/library:library
roles_path = roles:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/roles
[ssh_connection]
control_path = %(directory)s/%%h-%%r

View File

@ -4,7 +4,7 @@
set -eux
git clone https://github.com/redhat-openstack/ansible-role-tripleo-collect-logs.git \
$WORKSPACE/tripleo-quickstart/playbooks/roles/collect-logs
$WORKSPACE/tripleo-quickstart/roles/collect-logs
export ANSIBLE_INVENTORY=$WORKSPACE/hosts
export ANSIBLE_CONFIG=$WORKSPACE/tripleo-quickstart/ansible.cfg

View File

@ -0,0 +1,12 @@
#!/bin/bash
# Full CI test that runs quickstart.sh with only the
# release argument
set -eux
bash $WORKSPACE/tripleo-quickstart/quickstart.sh \
--tags all \
--config $WORKSPACE/tripleo-quickstart/config/general_config/minimal.yml \
--working-dir $WORKSPACE/ \
--no-clone \
$VIRTHOST $RELEASE

View File

@ -0,0 +1,2 @@
release: liberty
image_url: http://artifacts.ci.centos.org/artifacts/rdo/images/liberty/delorean/stable/undercloud.qcow2

View File

@ -0,0 +1,2 @@
release: mitaka
image_url: http://artifacts.ci.centos.org/artifacts/rdo/images/mitaka/delorean/stable/undercloud.qcow2

View File

@ -97,7 +97,10 @@ bootstrap () {
fi
fi
pip install -r $OPT_WORKDIR/tripleo-quickstart/$REQUIREMENTS
pushd $OPT_WORKDIR/tripleo-quickstart
python setup.py install
pip install -r $REQUIREMENTS
popd
)
}
@ -113,7 +116,6 @@ usage () {
echo " --ansible-debug"
echo " --bootstrap"
echo " --working-dir <directory>"
echo " --undercloud-image-url <url>"
echo " --tags <tag1>[,<tag2>,...]"
echo " --skip-tags <tag1>,[<tag2>,...]"
echo " --config <file>"
@ -153,11 +155,6 @@ while [ "x$1" != "x" ]; do
shift
;;
--undercloud-image-url|-u)
OPT_UNDERCLOUD_URL=$2
shift
;;
--tags|-t)
OPT_TAGS=$2
shift
@ -232,7 +229,7 @@ fi
# Set this default after option processing, because the default depends
# on another option.
: ${OPT_CONFIG:=$OOOQ_DIR/playbooks/centosci/minimal.yml}
: ${OPT_CONFIG:=$OOOQ_DIR/config/general_config/minimal.yml}
if [ "$OPT_INSTALL_DEPS" = 1 ]; then
echo "NOTICE: installing dependencies"
@ -272,22 +269,12 @@ RELEASE=$2
# quickstart playbook, since there are now some version specific behaviors.
# If the user has provided an explicit URL, we should warn them of that
# fact.
if [ -z "$RELEASE" ] && [ -n "$OPT_UNDERCLOUD_URL" ]; then
if [ -z "$RELEASE" ]; then
RELEASE=mitaka
echo "WARNING: The release defaults to $RELEASE, but you have" >&2
echo " provided an explicit undercloud image URL. If" >&2
echo " that image is not for $RELEASE, this may not work" >&2
elif [ -z "$RELEASE" ] && [ -z "$OPT_UNDERCLOUD_URL" ]; then
RELEASE=mitaka
fi
# we use this only if --undercloud-image-url was not provided on the
# command line.
: ${OPT_UNDERCLOUD_URL:=http://artifacts.ci.centos.org/artifacts/rdo/images/${RELEASE}/delorean/stable/undercloud.qcow2}
print_logo
echo "Installing OpenStack ${RELEASE:+"$RELEASE "}on host $VIRTHOST"
echo "Using directory $OPT_WORKDIR for a local working directory"
@ -320,10 +307,9 @@ fi
ansible-playbook -$VERBOSITY $OOOQ_DIR/playbooks/quickstart.yml \
-e @$OPT_CONFIG \
-e ansible_python_interpreter=/usr/bin/python \
-e image_url=$OPT_UNDERCLOUD_URL \
-e @$OOOQ_DIR/config/release/$RELEASE.yml \
-e local_working_dir=$OPT_WORKDIR \
-e virthost=$VIRTHOST \
-e release=$RELEASE \
${OPT_VARS[@]} \
${OPT_TAGS:+-t $OPT_TAGS} \
${OPT_SKIP_TAGS:+--skip-tags $OPT_SKIP_TAGS}

View File

@ -9,8 +9,8 @@ PATH=$PATH:/usr/sbin:/sbin
VMNAME=$1
# Get the MAC address of the first interface by looking for looking for the
# `<mac address...` line. Yes, we're parsing XML with awk. It's probably
# safe (because the XML is coming from libvirt, so we can be reasonably
# `<mac address...` line. Yes, we're parsing XML with awk. It's probably
# safe (because the XML is coming from libvirt, so we can be reasonably
# confident that the formatting will remain the same).
mac=$(virsh dumpxml $VMNAME | awk -F "'" '/mac address/ { print $2; exit }')

View File

@ -20,9 +20,12 @@ setup-hooks =
[files]
data_files =
usr/local/share/tripleo-quickstart = ansible.cfg
usr/local/share/tripleo-quickstart/playbooks = playbooks/*
usr/local/share/tripleo-quickstart/jenkins = jenkins/*
usr/local/share/tripleo-quickstart/roles = roles/*
usr/local/share/tripleo-quickstart/library = library/*
usr/local/share/tripleo-quickstart/test_plugins = test_plugins/*
tripleo-quickstart/playbooks = playbooks/*
tripleo-quickstart/config = config/*
[wheel]
universal = 1