From bfaa804d5ed59b534f1f3b220b8ca58de3bdae8a Mon Sep 17 00:00:00 2001 From: James Slagle Date: Mon, 26 Jan 2015 10:13:08 -0500 Subject: [PATCH] Add a command to run the config tools provision.sh --- jenkins-jobs/instack-ironic-deployment.yaml | 13 +++++++++++++ scripts/instack-ironic-deployment | 21 ++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/jenkins-jobs/instack-ironic-deployment.yaml b/jenkins-jobs/instack-ironic-deployment.yaml index 742b0769e..bf0b56cb0 100644 --- a/jenkins-jobs/instack-ironic-deployment.yaml +++ b/jenkins-jobs/instack-ironic-deployment.yaml @@ -141,3 +141,16 @@ --show-profile --setup-flavors --deploy-nodes" +- job: + name: 'instack-ironic-deployment-config-tools-provision' + description: 'Run config-tools provision.sh to prep for Puppet' + project-type: freestyle + wrappers: + - ansicolor: + colormap: xterm + builders: + - shell: > + sudo /bin/bash -c " + source /root/stackrc; + /home/stack/instack-undercloud/scripts/instack-ironic-deployment -x + --config-tools-provision" diff --git a/scripts/instack-ironic-deployment b/scripts/instack-ironic-deployment index 587f59ed3..25f943f99 100755 --- a/scripts/instack-ironic-deployment +++ b/scripts/instack-ironic-deployment @@ -32,13 +32,15 @@ function show_options () { echo " deployed node." echo " --delete-stack -- Wait until the stack has deleted." echo " --delete-nodes -- Delete all nodes." + echo " --config-tools-provision" + echo " -- Run provision.sh for config-tools" echo " -x -- enable tracing" echo " --help, -h -- Print this help message." echo exit $1 } -TEMP=$(getopt -o ,h -l,register-nodes,nodes-json:,discover-nodes,deploy-nodes,help,setup-flavors,show-profile,check-ssh,delete-stack,delete-nodes -o,x,h -n $SCRIPT_NAME -- "$@") +TEMP=$(getopt -o ,h -l,register-nodes,nodes-json:,discover-nodes,deploy-nodes,help,setup-flavors,show-profile,check-ssh,delete-stack,delete-nodes,config-tools-provision -o,x,h -n $SCRIPT_NAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! @@ -53,6 +55,7 @@ SHOW_PROFILE= CHECK_SSH= DELETE_STACK= DELETE_NODES= +CONFIG_TOOLS_PROVISION= STDERR=/dev/null DEPLOY_NAME=${DEPLOY_NAME:-"ironic-discover"} @@ -68,6 +71,7 @@ while true ; do --check-ssh) CHECK_SSH="1"; shift 1;; --delete-stack) DELETE_STACK="1"; shift 1;; --delete-nodes) DELETE_NODES="1"; shift 1;; + --config-tools-provision) CONFIG_TOOLS_PROVISION="1"; shift 1;; -x) set -x; STDERR=/dev/stderr; shift 1;; -h | --help) show_options 0;; --) shift ; break ;; @@ -265,6 +269,17 @@ function delete_nodes { done } +function config_tools_provision { + pushd /opt/stack/config-tools/ + sudo mkdir -p /var/www/install + sudo bash -x ./provision.sh master https://github.com/agroup/spinalstack-env.git/etest.yml version=master + for x in 0 1 2; do + sudo sed -i -e "s/SERVER$x/$(nova show openstack$x | grep ctlplane | grep -Eo "192[^ ]+")/g" env/etest.yml + done + sudo bash -x ./provision.sh -l master https://github.com/agroup/spinalstack-env.git/etest.yml version=master + popd +} + echo "Preparing for deployment..." if [ "$REGISTER_NODES" = 1 ]; then @@ -295,6 +310,10 @@ if [ "$DELETE_NODES" = 1 ]; then delete_nodes fi +if [ "$CONFIG_TOOLS_PROVISION" = 1 ]; then + config_tools_provision +fi + echo "Prepared." if [ "$DEPLOY_NODES" = 1 ]; then