aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSwapnil Kulkarni (coolsvap) <me@coolsvap.net>2016-05-17 23:06:59 +0530
committerSwapnil Kulkarni (coolsvap) <me@coolsvap.net>2016-05-21 01:51:17 +0000
commite1b5b149f26df2028f65652ac0d4a9509b23fe4c (patch)
tree32caf3167bb743c3dfa11361cd05bde31b3f0e32 /tools
parent6aa81433db64d508817cd39aaf37a99820977776 (diff)
downloadkolla-e1b5b149f26df2028f65652ac0d4a9509b23fe4c.tar.gz
kolla-e1b5b149f26df2028f65652ac0d4a9509b23fe4c.zip
Make passwords.yml file generation configurable
partially implements blueprint multiple-clouds Change-Id: I676c4245e6f058ffbed345970ee78d1750dd0f2f
Diffstat (limited to 'tools')
-rwxr-xr-xtools/kolla-ansible27
1 files changed, 16 insertions, 11 deletions
diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index 66c74c108..3a8ffd2ab 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -28,14 +28,15 @@ function usage {
Usage: $0 COMMAND [options]
Options:
- --inventory, -i <inventory_path> Specify path to ansible inventory file
- --playbook, -p <playbook_path> Specify path to ansible playbook file
- --configdir <config_path> Specify path to directory with globals.yml
- --keyfile, -k <key_file> Specify path to ansible vault keyfile
- --help, -h Show this usage information
- --tags, -t <tags> Only run plays and tasks tagged with these values
- --extra, -e <ansible variables> Set additional variables as key=value or YAML/JSON passed to ansible-playbook
- --verbose, -v Increase verbosity of ansible-playbook
+ --inventory, -i <inventory_path> Specify path to ansible inventory file
+ --playbook, -p <playbook_path> Specify path to ansible playbook file
+ --configdir <config_path> Specify path to directory with globals.yml
+ --keyfile, -k <key_file> Specify path to ansible vault keyfile
+ --help, -h Show this usage information
+ --tags, -t <tags> Only run plays and tasks tagged with these values
+ --extra, -e <ansible variables> Set additional variables as key=value or YAML/JSON passed to ansible-playbook
+ --passwords <passwords_path> Specify path to the passwords file
+ --verbose, -v Increase verbosity of ansible-playbook
Commands:
prechecks Do pre-deployment checks for hosts
@@ -53,7 +54,7 @@ EOF
SHORT_OPTS="hi:p:t:k:e:v"
-LONG_OPTS="help,inventory:,playbook:,tags:,keyfile:,extra:,verbose,configdir:"
+LONG_OPTS="help,inventory:,playbook:,tags:,keyfile:,extra:,verbose,configdir:,passwords:,"
ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
eval set -- "$ARGS"
@@ -65,6 +66,7 @@ PLAYBOOK="${BASEDIR}/ansible/site.yml"
VERBOSITY=
EXTRA_OPTS=
CONFIG_DIR="/etc/kolla"
+PASSWORDS_FILE="${CONFIG_DIR}/passwords.yml"
while [ "$#" -gt 0 ]; do
case "$1" in
@@ -104,7 +106,10 @@ while [ "$#" -gt 0 ]; do
EXTRA_OPTS="$EXTRA_OPTS -e $2"
shift 2
;;
-
+ (--passwords)
+ PASSWORDS_FILE="$2"
+ shift 2
+ ;;
(--help|-h)
usage
shift
@@ -171,6 +176,6 @@ case "$1" in
;;
esac
-CONFIG_OPTS="-e @${CONFIG_DIR}/globals.yml -e @${CONFIG_DIR}/passwords.yml -e CONFIG_DIR=${CONFIG_DIR}"
+CONFIG_OPTS="-e @${CONFIG_DIR}/globals.yml -e @${PASSWORDS_FILE} -e CONFIG_DIR=${CONFIG_DIR}"
CMD="ansible-playbook -i $INVENTORY $CONFIG_OPTS $EXTRA_OPTS $PLAYBOOK $VERBOSITY"
process_cmd