add a reference to #156

we ensure we call 'db sync' scripts only once.
This commit is contained in:
Gonéri Le Bouder
2014-02-04 16:21:03 +01:00
parent 82a32eaee0
commit 7797b4986c
6 changed files with 20 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ class cloud::compute(
# Note(EmilienM):
# We check if DB tables are created, if not we populate Nova DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-cloud/issues/156
exec {'nova_db_sync':
command => '/usr/bin/nova-manage db sync',
unless => "/usr/bin/mysql nova -h ${nova_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"

View File

@@ -225,6 +225,11 @@ class cloud::database::sql (
privileges => ['all']
}
# TODO(Gonéri):
# Here we should do the db_sync.
# https://github.com/enovance/puppet-cloud/issues/156
Database_user<<| |>>
} # if $::hostname == $galera_master

View File

@@ -528,6 +528,9 @@ class cloud::identity (
# Note(EmilienM):
# We check if DB tables are created, if not we populate Keystone DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-cloud/issues/156
exec {'keystone_db_sync':
command => '/usr/bin/keystone-manage db_sync',
unless => "/usr/bin/mysql keystone -h ${keystone_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"

View File

@@ -129,6 +129,9 @@ class cloud::image(
# Note(EmilienM):
# We check if DB tables are created, if not we populate Glance DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-cloud/issues/156
exec {'glance_db_sync':
command => '/usr/bin/glance-manage db_sync',
unless => "/usr/bin/mysql glance -h ${glance_db_host} -u ${encoded_glance_user} -p${encoded_glance_password} -e \"show tables\" | /bin/grep Tables"

View File

@@ -55,6 +55,9 @@ class cloud::orchestration(
# Note(EmilienM):
# We check if DB tables are created, if not we populate Heat DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-cloud/issues/156
exec {'heat_db_sync':
command => '/usr/bin/heat-manage --config-file /etc/heat/heat.conf db_sync',
unless => "/usr/bin/mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"

View File

@@ -49,6 +49,9 @@ class cloud::volume(
# Note(EmilienM):
# We check if DB tables are created, if not we populate Cinder DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-cloud/issues/156
exec {'cinder_db_sync':
command => '/usr/bin/cinder-manage db sync',
unless => "/usr/bin/mysql cinder -h ${cinder_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"