diff --git a/manifests/compute.pp b/manifests/compute.pp index f39180a1..d4e7a736 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -91,4 +91,13 @@ class cloud::compute( 'DEFAULT/resume_guests_state_on_host_boot': value => true; } + # 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 + exec {'nova_db_sync': + command => 'nova-manage db sync', + path => '/usr/bin', + unless => "mysql nova -h ${nova_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables" + } + } diff --git a/manifests/identity.pp b/manifests/identity.pp index 9ed71138..66a87bcb 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -525,6 +525,14 @@ class cloud::identity ( password => $ks_heat_password } + # 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 + exec {'keystone_db_sync': + command => 'keystone-manage db_sync', + path => '/usr/bin', + unless => "mysql keystone -h ${keystone_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables" + } @@haproxy::balancermember{"${::fqdn}-keystone_api": listening_service => 'keystone_api_cluster', diff --git a/manifests/network/controller.pp b/manifests/network/controller.pp index ffdc60b8..c6020cec 100644 --- a/manifests/network/controller.pp +++ b/manifests/network/controller.pp @@ -45,6 +45,15 @@ class cloud::network::controller( api_workers => $::processorcount } + # Note(EmilienM): + # We check if DB tables are created, if not we populate Neutron DB. + # It's a hack to fit with our setup where we run MySQL/Galera + exec {'neutron_db_sync': + command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head', + path => '/usr/bin', + unless => "mysql neutron -h ${neutron_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables" + } + @@haproxy::balancermember{"${::fqdn}-neutron_api": listening_service => 'neutron_api_cluster', server_names => $::hostname, diff --git a/manifests/orchestration.pp b/manifests/orchestration.pp index 44bf588c..03dce54b 100644 --- a/manifests/orchestration.pp +++ b/manifests/orchestration.pp @@ -52,4 +52,13 @@ class cloud::orchestration( debug => $debug, } + # 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 + exec {'heat_db_sync': + command => 'heat-manage --config-file /etc/heat/heat.conf db_sync', + path => '/usr/bin', + unless => "mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables" + } + } diff --git a/manifests/volume.pp b/manifests/volume.pp index 3fe3cccb..8e548521 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -46,4 +46,13 @@ class cloud::volume( class { 'cinder::ceilometer': } + # 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 + exec {'cinder_db_sync': + command => 'cinder-manage db sync', + path => '/usr/bin', + unless => "mysql cinder -h ${cinder_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables" + } + }