From abbd8a61a89d0e9a05ee2e1ca29a66d14f86279e Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Wed, 20 Feb 2013 21:48:53 -0800 Subject: [PATCH] Update keystone element to use os-refresh-config. Change-Id: I15595d80ee7fad04d964aaa83a403d9303f6aa55 --- elements/keystone-config/element-deps | 1 + .../etc/keystone/keystone.conf | 33 +++++++++++++++++-- .../etc/keystone/logging.conf | 10 ++---- .../etc/keystone/policy.json | 0 elements/keystone/element-deps | 3 +- elements/keystone/install.d/70-keystone | 9 +++++ elements/keystone/post-configure | 3 ++ 7 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 elements/keystone-config/element-deps rename elements/{keystone => keystone-config}/os-config-applier/etc/keystone/keystone.conf (76%) rename elements/{keystone => keystone-config}/os-config-applier/etc/keystone/logging.conf (81%) rename elements/{keystone => keystone-config}/os-config-applier/etc/keystone/policy.json (100%) create mode 100755 elements/keystone/install.d/70-keystone create mode 100755 elements/keystone/post-configure diff --git a/elements/keystone-config/element-deps b/elements/keystone-config/element-deps new file mode 100644 index 00000000..c2199a4e --- /dev/null +++ b/elements/keystone-config/element-deps @@ -0,0 +1 @@ +os-config-applier diff --git a/elements/keystone/os-config-applier/etc/keystone/keystone.conf b/elements/keystone-config/os-config-applier/etc/keystone/keystone.conf similarity index 76% rename from elements/keystone/os-config-applier/etc/keystone/keystone.conf rename to elements/keystone-config/os-config-applier/etc/keystone/keystone.conf index 3c9e67ad..3eb9dde8 100644 --- a/elements/keystone/os-config-applier/etc/keystone/keystone.conf +++ b/elements/keystone-config/os-config-applier/etc/keystone/keystone.conf @@ -1,16 +1,45 @@ [DEFAULT] -admin_token = funkytonwn +admin_token = {{admin-token}} + +debug = True [sql] -connection = mysql://{{OpenStack::Keystone::Database.User}}:{{OpenStack::Keystone::Database.Password}}@{{OpenStack::Keystone::Database.Host}}/{{OpenStack::Keystone::Database.Database}} +connection = {{keystone.db}} [identity] +driver = keystone.identity.backends.sql.Identity + [catalog] +driver = keystone.catalog.backends.sql.Catalog + [token] +driver = keystone.token.backends.kvs.Token + +# Amount of time a token should remain valid (in seconds) +# expiration = 86400 + [policy] +# driver = keystone.policy.backends.sql.Policy + [ec2] +# driver = keystone.contrib.ec2.backends.kvs.Ec2 + [ssl] +#enable = True +#certfile = /etc/keystone/ssl/certs/keystone.pem +#keyfile = /etc/keystone/ssl/private/keystonekey.pem +#ca_certs = /etc/keystone/ssl/certs/ca.pem +#cert_required = True + [signing] +#token_format = PKI +#certfile = /etc/keystone/ssl/certs/signing_cert.pem +#keyfile = /etc/keystone/ssl/private/signing_key.pem +#ca_certs = /etc/keystone/ssl/certs/ca.pem +#key_size = 1024 +#valid_days = 3650 +#ca_password = None + [ldap] [filter:debug] diff --git a/elements/keystone/os-config-applier/etc/keystone/logging.conf b/elements/keystone-config/os-config-applier/etc/keystone/logging.conf similarity index 81% rename from elements/keystone/os-config-applier/etc/keystone/logging.conf rename to elements/keystone-config/os-config-applier/etc/keystone/logging.conf index d87d3a28..52d64cef 100644 --- a/elements/keystone/os-config-applier/etc/keystone/logging.conf +++ b/elements/keystone-config/os-config-applier/etc/keystone/logging.conf @@ -5,11 +5,11 @@ keys=root keys=normal,normal_with_name,debug [handlers] -keys=production,file,devel +keys=production,devel [logger_root] level=WARNING -handlers=file +handlers= [handler_production] class=handlers.SysLogHandler @@ -17,12 +17,6 @@ level=ERROR formatter=normal_with_name args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) -[handler_file] -class=FileHandler -level=DEBUG -formatter=normal_with_name -args=('keystone.log', 'a') - [handler_devel] class=StreamHandler level=NOTSET diff --git a/elements/keystone/os-config-applier/etc/keystone/policy.json b/elements/keystone-config/os-config-applier/etc/keystone/policy.json similarity index 100% rename from elements/keystone/os-config-applier/etc/keystone/policy.json rename to elements/keystone-config/os-config-applier/etc/keystone/policy.json diff --git a/elements/keystone/element-deps b/elements/keystone/element-deps index 338bd781..24f46dd7 100644 --- a/elements/keystone/element-deps +++ b/elements/keystone/element-deps @@ -1,2 +1,3 @@ +keystone-config +os-refresh-config os-svc-install -os-config-applier diff --git a/elements/keystone/install.d/70-keystone b/elements/keystone/install.d/70-keystone new file mode 100755 index 00000000..42d02253 --- /dev/null +++ b/elements/keystone/install.d/70-keystone @@ -0,0 +1,9 @@ +#!/bin/bash +set -eux + +os-svc-install -n keystone -u keystone -r https://github.com/openstack/keystone.git +os-svc-daemon keystone keystone /usr/local/bin/keystone-all "--config-dir /etc/keystone --log-config /etc/keystone/logging.conf" +install -m 0755 -o keystone -g keystone -d /etc/keystone/ssl + +install -m 0755 -o root -g root $(dirname $0)/../post-configure \ + $(os-refresh-config --print-base)/post-configure.d/70-keystone diff --git a/elements/keystone/post-configure b/elements/keystone/post-configure new file mode 100755 index 00000000..3e6d8dde --- /dev/null +++ b/elements/keystone/post-configure @@ -0,0 +1,3 @@ +#!/bin/bash +set -eu +service keystone restart