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-cinder-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-cinder-setup')
-rw-r--r-- | openstack/usr/share/openstack/openstack-cinder-setup | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/openstack/usr/share/openstack/openstack-cinder-setup b/openstack/usr/share/openstack/openstack-cinder-setup index f97853f6..ade53e92 100644 --- a/openstack/usr/share/openstack/openstack-cinder-setup +++ b/openstack/usr/share/openstack/openstack-cinder-setup @@ -66,18 +66,30 @@ if [ ! -d /var/log/cinder ]; then chown -R cinder:cinder /var/log/cinder fi -# Setup the cinder database -if [ ! -e /var/lib/cinder/cinder.sqlite ]; then - chown -R cinder:cinder /var/lib/cinder - sudo -u cinder cinder-manage db sync -fi - # Create the volumes directory for cinder if [ ! -d /var/lib/cinder/volumes ]; then mkdir -p /var/lib/cinder/volumes chown -R cinder:cinder /var/lib/cinder/volumes fi +# Setup the cinder database +if ! sudo -u postgres psql -lqt | grep -q cinder; then + # Create posgreSQL user + sudo -u postgres createuser \ + --pwprompt --encrypted \ + --no-adduser --no-createdb \ + --no-password \ + ##CINDER_DB_USER## + + sudo -u postgres createdb \ + --owner=##CINDER_DB_USER## \ + cinder + + sudo -u cinder cinder-manage db sync +fi + +chown -R cinder:cinder /var/lib/cinder + # This is only for testing purposes and we need to change it for # something more robust to deploy in production. # This also assumes that the user will add a second disk to its VM |