@@ -94,6 +94,9 @@ class cloud::compute(
 | 
				
			|||||||
  # Note(EmilienM):
 | 
					  # Note(EmilienM):
 | 
				
			||||||
  # We check if DB tables are created, if not we populate Nova DB.
 | 
					  # 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
 | 
					  # 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':
 | 
					  exec {'nova_db_sync':
 | 
				
			||||||
    command => '/usr/bin/nova-manage 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"
 | 
					    unless  => "/usr/bin/mysql nova -h ${nova_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -225,6 +225,11 @@ class cloud::database::sql (
 | 
				
			|||||||
      privileges => ['all']
 | 
					      privileges => ['all']
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # TODO(Gonéri):
 | 
				
			||||||
 | 
					    # Here we should do the db_sync.
 | 
				
			||||||
 | 
					    # https://github.com/enovance/puppet-cloud/issues/156
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Database_user<<| |>>
 | 
					    Database_user<<| |>>
 | 
				
			||||||
  } # if $::hostname == $galera_master
 | 
					  } # if $::hostname == $galera_master
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -528,6 +528,9 @@ class cloud::identity (
 | 
				
			|||||||
  # Note(EmilienM):
 | 
					  # Note(EmilienM):
 | 
				
			||||||
  # We check if DB tables are created, if not we populate Keystone DB.
 | 
					  # 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
 | 
					  # 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':
 | 
					  exec {'keystone_db_sync':
 | 
				
			||||||
    command => '/usr/bin/keystone-manage 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"
 | 
					    unless  => "/usr/bin/mysql keystone -h ${keystone_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -129,6 +129,9 @@ class cloud::image(
 | 
				
			|||||||
  # Note(EmilienM):
 | 
					  # Note(EmilienM):
 | 
				
			||||||
  # We check if DB tables are created, if not we populate Glance DB.
 | 
					  # 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
 | 
					  # 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':
 | 
					  exec {'glance_db_sync':
 | 
				
			||||||
    command => '/usr/bin/glance-manage 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"
 | 
					    unless  => "/usr/bin/mysql glance -h ${glance_db_host} -u ${encoded_glance_user} -p${encoded_glance_password} -e \"show tables\" | /bin/grep Tables"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,6 +55,9 @@ class cloud::orchestration(
 | 
				
			|||||||
  # Note(EmilienM):
 | 
					  # Note(EmilienM):
 | 
				
			||||||
  # We check if DB tables are created, if not we populate Heat DB.
 | 
					  # 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
 | 
					  # 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':
 | 
					  exec {'heat_db_sync':
 | 
				
			||||||
    command => '/usr/bin/heat-manage --config-file /etc/heat/heat.conf 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"
 | 
					    unless  => "/usr/bin/mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,6 +49,9 @@ class cloud::volume(
 | 
				
			|||||||
  # Note(EmilienM):
 | 
					  # Note(EmilienM):
 | 
				
			||||||
  # We check if DB tables are created, if not we populate Cinder DB.
 | 
					  # 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
 | 
					  # 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':
 | 
					  exec {'cinder_db_sync':
 | 
				
			||||||
    command => '/usr/bin/cinder-manage 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"
 | 
					    unless  => "/usr/bin/mysql cinder -h ${cinder_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user