From 7797b4986c3bacc9385037cc8d10cec24e8b7f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 4 Feb 2014 16:21:03 +0100 Subject: [PATCH] add a reference to #156 we ensure we call 'db sync' scripts only once. --- manifests/compute.pp | 3 +++ manifests/database/sql.pp | 5 +++++ manifests/identity.pp | 3 +++ manifests/image.pp | 3 +++ manifests/orchestration.pp | 3 +++ manifests/volume.pp | 3 +++ 6 files changed, 20 insertions(+) diff --git a/manifests/compute.pp b/manifests/compute.pp index 9ed72562..73a54c0a 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -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" diff --git a/manifests/database/sql.pp b/manifests/database/sql.pp index 58d50e7f..d7c9301e 100644 --- a/manifests/database/sql.pp +++ b/manifests/database/sql.pp @@ -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 diff --git a/manifests/identity.pp b/manifests/identity.pp index 63e5828c..40e20239 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -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" diff --git a/manifests/image.pp b/manifests/image.pp index e1691245..7b00d7db 100644 --- a/manifests/image.pp +++ b/manifests/image.pp @@ -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" diff --git a/manifests/orchestration.pp b/manifests/orchestration.pp index 682ec6d8..c01cb79e 100644 --- a/manifests/orchestration.pp +++ b/manifests/orchestration.pp @@ -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" diff --git a/manifests/volume.pp b/manifests/volume.pp index 39a709a9..ce209b4c 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -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"