From 958fc417c08b039ac7b1e2c55ccdcf9193ecc7ea Mon Sep 17 00:00:00 2001 From: James Slagle Date: Fri, 27 Mar 2015 12:22:05 -0400 Subject: [PATCH] Configure tuskar db We've switched to puppet and are no longer using the boot-stack element that was responsible for creating all the initial db's. However, tuskar is still installed via the element, so we need to setup it's db manually. The needed configuration is added to config.json.template, including the bootstrap dict since 90-tuskar-db-sync relies on os-is-boostrap-host. Change-Id: Ifd3bc393f76918dd208fa1e80ef01cf973770625 --- .../undercloud-stack-config/config.json.template | 16 +++++++++++++--- .../configure.d/80-tuskar-db-create | 10 ++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 elements/undercloud-stack-config/os-refresh-config/configure.d/80-tuskar-db-create diff --git a/elements/undercloud-stack-config/config.json.template b/elements/undercloud-stack-config/config.json.template index 588928c93..d4e7be7cf 100644 --- a/elements/undercloud-stack-config/config.json.template +++ b/elements/undercloud-stack-config/config.json.template @@ -39,10 +39,20 @@ } ] }, - "tuskar": { - "service-password": "{{UNDERCLOUD_TUSKAR_PASSWORD}}" - }, "ironic": { "service-password": "{{UNDERCLOUD_IRONIC_PASSWORD}}" + }, + "tuskar": { + "service-password": "{{UNDERCLOUD_TUSKAR_PASSWORD}}", + "db": "mysql://tuskar:{{UNDERCLOUD_TUSKAR_PASSWORD}}@localhost/tuskar?charset=utf8", + "heat_keystone": { + "username": "admin", + "password": "unset", + "tenant_name": "admin" + } + }, + "bootstrap_host": { + "bootstrap_nodeid": "undercloud", + "nodeid": "undercloud" } } diff --git a/elements/undercloud-stack-config/os-refresh-config/configure.d/80-tuskar-db-create b/elements/undercloud-stack-config/os-refresh-config/configure.d/80-tuskar-db-create new file mode 100755 index 000000000..3e22657c4 --- /dev/null +++ b/elements/undercloud-stack-config/os-refresh-config/configure.d/80-tuskar-db-create @@ -0,0 +1,10 @@ +#!/bin/bash + +set -eux +set -o pipefail + +# This should run before configure.d/90-tuskar-db-sync + +UNDERCLOUD_TUSKAR_PASSWORD=$(os-apply-config --key tuskar.service-password) + +os-db-create tuskar tuskar $UNDERCLOUD_TUSKAR_PASSWORD