From acb145de3298cd4f2c27d7fd849e56ba527fe023 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 5 Oct 2015 16:39:26 -0400 Subject: [PATCH] Create functions for common bits * Move out some code from install_modules.sh to have a functions script. * Update install_modules.sh script to use functions. Change-Id: Ie87b8eac71d5edb555e9a1637bea84bc9e268497 --- functions | 70 ++++++++++++++++++++++++++++++++++++++++++++++ install_modules.sh | 38 ++----------------------- 2 files changed, 72 insertions(+), 36 deletions(-) create mode 100644 functions diff --git a/functions b/functions new file mode 100644 index 000000000..476763670 --- /dev/null +++ b/functions @@ -0,0 +1,70 @@ +#!/bin/bash +# +# functions - puppet-openstack-integration specific functions +# + +# Install external Puppet modules with r10k +# Uses the following variables: +# +# - ``SCRIPT_DIR`` must be set to script path +# - ``GEM_BIN_DIR`` must be set to Gem bin directory +install_external() { + PUPPETFILE=${SCRIPT_DIR}/Puppetfile1 ${GEM_BIN_DIR}r10k puppetfile install -v +} + +# Install Puppet OpenStack modules with zuul-cloner +# Uses the following variables: +# +# - ``PUPPETFILE_DIR`` must be set to Puppet modules directory +# - ``SCRIPT_DIR`` must be set to script path +# - ``ZUUL_REF`` must be set to Zuul ref +# - ``ZUUL_BRANCH`` must be set to Zuul branch +# - ``ZUUL_URL`` must be set to Zuul URL +install_openstack() { + cat > clonemap.yaml < clonemap.yaml <