Add an element installing tuskar API service

This should make it easier to deploy tuskar in the undercloud
(basically, one will just add 'tuskar' the the list of elements
when building a disk image for the undercloud node).

This depends on Ib66e688bd7500f03dea7d4282607cd51078e9a51 to be
merged into tripleo-heat-templates to work properly.

Change-Id: I1d16e535ae50a06a8792e1613bb6b6c4647bf128
This commit is contained in:
Roman Podolyaka 2013-09-20 18:20:08 +03:00
parent 3efbeac531
commit 70f3634d47
8 changed files with 56 additions and 0 deletions

View File

@ -21,6 +21,11 @@ if [ -x "$venvs/ironic/bin/ironic-dbsync" ] ; then
$venvs/ironic/bin/ironic-dbsync --config-file /etc/ironic/ironic.conf
fi
if [ -x "$venvs/tuskar/bin/tuskar-dbsync" ] ; then
os-db-create tuskar tuskar $db_pass
$venvs/tuskar/bin/tuskar-dbsync --config-file /etc/tuskar/tuskar.conf
fi
os-db-create nova nova $db_pass
$venvs/nova/bin/nova-manage db sync

20
elements/tuskar/README.md Normal file
View File

@ -0,0 +1,20 @@
Install tuskar service from git.
Configuration
-------------
Tuskar API requires the following keys to be set via Heat Metadata.
tuskar:
overcloud-admin-password:
- the password of the overcloud admin user. Use
OvercloudAdminPassword template parameter to
override this option.
db: "mysql://tuskar:unset@localhost/tuskar?charset=utf8"
- the connection string for a DB to be used by tuskar-api.
username:
- the name of the user to deploy the overcloud on behalf of
password:
- the password of the user to deploy the overcloud on behalf of
tenant_name:
- the tenant name of the user to deploy the overcloud on behalf of

View File

@ -0,0 +1,4 @@
os-svc-install
os-refresh-config
os-apply-config
source-repositories

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -eux
install-packages swig
os-svc-install -n tuskar -u tuskar -r /opt/stack/tuskar
install -d -m 0750 -o tuskar -g tuskar /etc/tuskar
cp -a /opt/stack/tuskar/etc/tuskar/policy.json /etc/tuskar
os-svc-daemon tuskar-api tuskar tuskar-api "--config-dir /etc/tuskar"

View File

@ -0,0 +1,5 @@
keystone_url: "http://{{keystone.host}}:5000/v2.0/"
nova_username: "admin"
nova_tenantname: "admin"
# NOTE(rpodolyaka): limitation of tuskar-api, see https://bugs.launchpad.net/tuskar/+bug/1235236
nova_password: "{{tuskar.overcloud-admin-passsword}}"

View File

@ -0,0 +1,8 @@
[database]
connection={{tuskar.db}}
[heat_keystone]
username = {{tuskar.user}}
tenant_name = {{tuskar.tenant_name}}
password = {{tuskar.password}}
auth_url = http://{{keystone.host}}:35357/v2.0

View File

@ -0,0 +1,3 @@
#!/bin/bash
set -eux
service tuskar-api restart

View File

@ -0,0 +1 @@
tuskar git /opt/stack/tuskar https://git.openstack.org/cgit/openstack/tuskar