diff options
author | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2015-01-21 18:53:45 +0000 |
---|---|---|
committer | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2015-01-22 12:46:31 +0000 |
commit | 5fec3bdcd0fc99a10ebd8fd4dfd6b88aaeffb5a6 (patch) | |
tree | a9f262722b48142cf906a3bc3d2c1f618e36f8e2 /openstack/usr/share/openstack/openstack-keystone-setup | |
parent | 704f7701e94739ee6fabbf4d3586f295572226f6 (diff) | |
download | definitions-5fec3bdcd0fc99a10ebd8fd4dfd6b88aaeffb5a6.tar.gz |
Setup cinder, glance, nova and keystone to use postgres instead of sqlite
Diffstat (limited to 'openstack/usr/share/openstack/openstack-keystone-setup')
-rw-r--r-- | openstack/usr/share/openstack/openstack-keystone-setup | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/openstack/usr/share/openstack/openstack-keystone-setup b/openstack/usr/share/openstack/openstack-keystone-setup index 2e9a0dcb..9623f129 100644 --- a/openstack/usr/share/openstack/openstack-keystone-setup +++ b/openstack/usr/share/openstack/openstack-keystone-setup @@ -24,13 +24,40 @@ getent passwd keystone >/dev/null || \ useradd --uid 163 -r -g keystone -d /var/lib/keystone -s /sbin/nologin \ -c "OpenStack Keystone Daemons" keystone +# Keystone compute configuration +if [ ! -d /var/run/keystone ]; then + mkdir -p /var/run/keystone + chown -R keystone:keystone /var/run/keystone +fi + +if [ ! -d /var/lock/keystone ]; then + mkdir -p /var/lock/keystone + chown -R keystone:keystone /var/lock/keystone +fi + +if [ ! -d /var/log/keystone ]; then + mkdir -p /var/log/keystone + chown -R keystone:keystone /var/log/keystone +fi + # Setup the keystone database +if ! sudo -u postgres psql -lqt | grep -q keystone; then + # Create posgreSQL user + sudo -u postgres createuser \ + --pwprompt --encrypted \ + --no-adduser --no-createdb \ + --no-password \ + ##KEYSTONE_DB_USER## + + sudo -u postgres createdb \ + --owner=##KEYSTONE_DB_USER## \ + keystone -if [ ! -e /var/lib/keystone/keystone.sqlite ]; then - chown -R keystone:keystone /var/lib/keystone sudo -u keystone keystone-manage db_sync fi +chown -R keystone:keystone /var/lib/keystone + systemctl start openstack-keystone export OS_SERVICE_TOKEN=##KEYSTONE_TEMPORARY_ADMIN_TOKEN## |