diff --git a/manifests/aodh.pp b/manifests/aodh.pp index 3749b5c16..c8e1020a9 100644 --- a/manifests/aodh.pp +++ b/manifests/aodh.pp @@ -28,7 +28,14 @@ class openstack_integration::aodh ( debug => true, } class { 'aodh::db': - database_connection => 'mysql+pymysql://aodh:aodh@127.0.0.1/aodh?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'aodh', + 'password' => 'aodh', + 'database' => 'aodh', + 'charset' => 'utf8', + }), } class { 'aodh': default_transport_url => os_transport_url({ @@ -54,6 +61,7 @@ class openstack_integration::aodh ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'aodh', + host => $::openstack_integration::config::host, } class { 'aodh::keystone::auth': public_url => "${::openstack_integration::config::base_url}:8042", diff --git a/manifests/barbican.pp b/manifests/barbican.pp index aab313921..7b30aff83 100644 --- a/manifests/barbican.pp +++ b/manifests/barbican.pp @@ -21,9 +21,17 @@ class openstack_integration::barbican { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'barbican', + host => $::openstack_integration::config::host, } class { 'barbican::db': - database_connection => 'mysql+pymysql://barbican:barbican@127.0.0.1/barbican?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'barbican', + 'password' => 'barbican', + 'database' => 'barbican', + 'charset' => 'utf8', + }), } class { 'barbican::keystone::auth': public_url => "${::openstack_integration::config::base_url}:9311", diff --git a/manifests/cinder.pp b/manifests/cinder.pp index b8690e2b6..4f7407f4f 100644 --- a/manifests/cinder.pp +++ b/manifests/cinder.pp @@ -45,6 +45,7 @@ class openstack_integration::cinder ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'cinder', + host => $::openstack_integration::config::host, } class { 'cinder::keystone::auth': public_url_v3 => "${::openstack_integration::config::base_url}:8776/v3", @@ -65,7 +66,14 @@ class openstack_integration::cinder ( } } class { 'cinder::db': - database_connection => 'mysql+pymysql://cinder:cinder@127.0.0.1/cinder?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'cinder', + 'password' => 'cinder', + 'database' => 'cinder', + 'charset' => 'utf8', + }), } class { 'cinder': default_transport_url => os_transport_url({ diff --git a/manifests/designate.pp b/manifests/designate.pp index 70aff16ea..cd4643e47 100644 --- a/manifests/designate.pp +++ b/manifests/designate.pp @@ -24,6 +24,7 @@ class openstack_integration::designate { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'designate', + host => $::openstack_integration::config::host, } class { 'designate::logging': debug => true, @@ -39,7 +40,14 @@ class openstack_integration::designate { rabbit_use_ssl => $::openstack_integration::config::ssl, } class { 'designate::db': - database_connection => 'mysql+pymysql://designate:designate@127.0.0.1/designate?charset=utf8' + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'designate', + 'password' => 'designate', + 'database' => 'designate', + 'charset' => 'utf8', + }), } class { 'designate::coordination': backend_url => $::openstack_integration::config::tooz_url, diff --git a/manifests/ec2api.pp b/manifests/ec2api.pp index 3d2a143d1..f82f540b8 100644 --- a/manifests/ec2api.pp +++ b/manifests/ec2api.pp @@ -15,11 +15,19 @@ class openstack_integration::ec2api { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'ec2api', + host => $::openstack_integration::config::host, } case $::osfamily { 'RedHat': { class { 'ec2api::db': - database_connection => 'mysql+pymysql://ec2api:ec2api@127.0.0.1/ec2api?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'ec2api', + 'password' => 'ec2api', + 'database' => 'ec2api', + 'charset' => 'utf8', + }), } class { 'ec2api::db::sync': } class { 'ec2api::logging': diff --git a/manifests/glance.pp b/manifests/glance.pp index 3e3936c76..2310c7179 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -38,6 +38,7 @@ class openstack_integration::glance ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'glance', + host => $::openstack_integration::config::host, } include glance include glance::client @@ -99,7 +100,14 @@ class openstack_integration::glance ( debug => true, } class { 'glance::api::db': - database_connection => 'mysql+pymysql://glance:glance@127.0.0.1/glance?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'glance', + 'password' => 'glance', + 'database' => 'glance', + 'charset' => 'utf8', + }), } class { 'glance::api': workers => 2, diff --git a/manifests/gnocchi.pp b/manifests/gnocchi.pp index 9d5427f8e..e93380382 100644 --- a/manifests/gnocchi.pp +++ b/manifests/gnocchi.pp @@ -35,7 +35,14 @@ class openstack_integration::gnocchi ( debug => true, } class { 'gnocchi::db': - database_connection => 'mysql+pymysql://gnocchi:gnocchi@127.0.0.1/gnocchi?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'gnocchi', + 'password' => 'gnocchi', + 'database' => 'gnocchi', + 'charset' => 'utf8', + }), } class { 'gnocchi': coordination_url => $::openstack_integration::config::tooz_url, @@ -44,6 +51,7 @@ class openstack_integration::gnocchi ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'gnocchi', + host => $::openstack_integration::config::host, } # TODO(tkajinam): We need to find a way to enforce swift is up before diff --git a/manifests/heat.pp b/manifests/heat.pp index 2e147c60d..08d07e6d3 100644 --- a/manifests/heat.pp +++ b/manifests/heat.pp @@ -46,7 +46,14 @@ class openstack_integration::heat ( debug => true, } class { 'heat::db': - database_connection => 'mysql+pymysql://heat:heat@127.0.0.1/heat?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'heat', + 'password' => 'heat', + 'database' => 'heat', + 'charset' => 'utf8', + }), } class { 'heat': default_transport_url => os_transport_url({ @@ -72,6 +79,7 @@ class openstack_integration::heat ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'heat', + host => $::openstack_integration::config::host, } class { 'heat::keystone::auth': password => 'a_big_secret', diff --git a/manifests/ironic.pp b/manifests/ironic.pp index 316c17aa4..3c97f4f37 100644 --- a/manifests/ironic.pp +++ b/manifests/ironic.pp @@ -19,7 +19,14 @@ class openstack_integration::ironic { debug => true, } class { 'ironic::db': - database_connection => 'mysql+pymysql://ironic:ironic@127.0.0.1/ironic?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'ironic', + 'password' => 'ironic', + 'database' => 'ironic', + 'charset' => 'utf8', + }), } class { 'ironic': default_transport_url => os_transport_url({ @@ -36,6 +43,7 @@ class openstack_integration::ironic { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'ironic', + host => $::openstack_integration::config::host, } class { 'ironic::keystone::auth': public_url => "${::openstack_integration::config::base_url}:6385", @@ -82,7 +90,8 @@ class openstack_integration::ironic { class { 'ironic::inspector::db::mysql': charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, - password => 'a_big_secret', + password => 'ironic-inspector', + host => $::openstack_integration::config::host, } class { 'ironic::inspector::authtoken': password => 'a_big_secret', @@ -94,7 +103,14 @@ class openstack_integration::ironic { } class { 'ironic::pxe': } class { 'ironic::inspector::db': - database_connection => 'mysql+pymysql://ironic-inspector:a_big_secret@127.0.0.1/ironic-inspector?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'ironic-inspector', + 'password' => 'ironic-inspector', + 'database' => 'ironic-inspector', + 'charset' => 'utf8', + }), } class { 'ironic::inspector::ironic': password => 'a_big_secret', diff --git a/manifests/keystone.pp b/manifests/keystone.pp index 3d685c913..ef29d99cb 100644 --- a/manifests/keystone.pp +++ b/manifests/keystone.pp @@ -47,9 +47,17 @@ class openstack_integration::keystone ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'keystone', + host => $::openstack_integration::config::host, } class { 'keystone::db': - database_connection => 'mysql+pymysql://keystone:keystone@127.0.0.1/keystone', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'keystone', + 'password' => 'keystone', + 'database' => 'keystone', + 'charset' => 'utf8', + }), } class { 'keystone::logging': debug => true, diff --git a/manifests/magnum.pp b/manifests/magnum.pp index 64f2fcdb7..4eb972281 100644 --- a/manifests/magnum.pp +++ b/manifests/magnum.pp @@ -58,10 +58,18 @@ class openstack_integration::magnum ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'magnum', + host => $::openstack_integration::config::host, } class { 'magnum::db': - database_connection => 'mysql+pymysql://magnum:magnum@127.0.0.1/magnum', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'magnum', + 'password' => 'magnum', + 'database' => 'magnum', + 'charset' => 'utf8', + }), } class { 'magnum::keystone::domain': diff --git a/manifests/manila.pp b/manifests/manila.pp index 77860d3b7..caad8039e 100644 --- a/manifests/manila.pp +++ b/manifests/manila.pp @@ -34,6 +34,7 @@ class openstack_integration::manila ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'manila', + host => $::openstack_integration::config::host, } class { 'manila::keystone::auth': public_url => "${::openstack_integration::config::base_url}:8786/v1/%(tenant_id)s", @@ -50,7 +51,14 @@ class openstack_integration::manila ( debug => true, } class { 'manila::db': - database_connection => 'mysql+pymysql://manila:manila@127.0.0.1/manila?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'manila', + 'password' => 'manila', + 'database' => 'manila', + 'charset' => 'utf8', + }), } class { 'manila': default_transport_url => os_transport_url({ diff --git a/manifests/mistral.pp b/manifests/mistral.pp index 7bc8618ec..e68878100 100644 --- a/manifests/mistral.pp +++ b/manifests/mistral.pp @@ -26,7 +26,14 @@ class openstack_integration::mistral { debug => true, } class { 'mistral::db': - database_connection => 'mysql+pymysql://mistral:mistral@127.0.0.1/mistral?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'mistral', + 'password' => 'mistral', + 'database' => 'mistral', + 'charset' => 'utf8', + }), } class { 'mistral': default_transport_url => os_transport_url({ @@ -48,6 +55,7 @@ class openstack_integration::mistral { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'mistral', + host => $::openstack_integration::config::host, } class { 'mistral::api': service_name => 'httpd', diff --git a/manifests/murano.pp b/manifests/murano.pp index 90e6dea5a..51d86ded1 100644 --- a/manifests/murano.pp +++ b/manifests/murano.pp @@ -42,13 +42,21 @@ class openstack_integration::murano { class { 'murano::db::mysql': charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, - password => 'a_big_secret', + password => 'murano', + host => $::openstack_integration::config::host, } class { 'murano::logging': debug => true, } class { 'murano::db': - database_connection => 'mysql+pymysql://murano:a_big_secret@127.0.0.1/murano?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'murano', + 'password' => 'murano', + 'database' => 'murano', + 'charset' => 'utf8', + }), } class { 'murano::keystone::authtoken': password => 'a_big_secret', diff --git a/manifests/mysql.pp b/manifests/mysql.pp index 074120d85..57b2b1f9a 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -1,5 +1,13 @@ class openstack_integration::mysql { - class { 'mysql::server': } + include openstack_integration::config + + class { 'mysql::server': + override_options => { + 'mysqld' => { + 'bind-address' => $::openstack_integration::config::host, + }, + }, + } } diff --git a/manifests/neutron.pp b/manifests/neutron.pp index 14ee61c80..98bdfe25b 100644 --- a/manifests/neutron.pp +++ b/manifests/neutron.pp @@ -100,6 +100,7 @@ class openstack_integration::neutron ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'neutron', + host => $::openstack_integration::config::host, } class { 'neutron::keystone::auth': public_url => "${::openstack_integration::config::base_url}:9696", @@ -205,7 +206,14 @@ class openstack_integration::neutron ( } class { 'neutron::db': - database_connection => 'mysql+pymysql://neutron:neutron@127.0.0.1/neutron?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'neutron', + 'password' => 'neutron', + 'database' => 'neutron', + 'charset' => 'utf8', + }), } class { 'neutron::server': sync_db => true, diff --git a/manifests/nova.pp b/manifests/nova.pp index f59fc546f..ee7fe1da7 100644 --- a/manifests/nova.pp +++ b/manifests/nova.pp @@ -66,11 +66,13 @@ class openstack_integration::nova ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'nova', + host => $::openstack_integration::config::host, } class { 'nova::db::mysql_api': charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'nova', + host => $::openstack_integration::config::host, } include nova::cell_v2::simple_setup @@ -102,8 +104,22 @@ class openstack_integration::nova ( debug => true, } class { 'nova::db': - database_connection => 'mysql+pymysql://nova:nova@127.0.0.1/nova?charset=utf8', - api_database_connection => 'mysql+pymysql://nova_api:nova@127.0.0.1/nova_api?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'nova', + 'password' => 'nova', + 'database' => 'nova', + 'charset' => 'utf8', + }), + api_database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'nova_api', + 'password' => 'nova', + 'database' => 'nova_api', + 'charset' => 'utf8', + }), } class { 'nova': default_transport_url => $default_transport_url, diff --git a/manifests/octavia.pp b/manifests/octavia.pp index edd775f24..ddd1ce1df 100644 --- a/manifests/octavia.pp +++ b/manifests/octavia.pp @@ -33,7 +33,14 @@ class openstack_integration::octavia ( debug => true, } class { 'octavia::db': - database_connection => 'mysql+pymysql://octavia:octavia@127.0.0.1/octavia?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'octavia', + 'password' => 'octavia', + 'database' => 'octavia', + 'charset' => 'utf8', + }), } class { 'octavia': default_transport_url => os_transport_url({ @@ -59,6 +66,7 @@ class openstack_integration::octavia ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'octavia', + host => $::openstack_integration::config::host, } class { 'octavia::keystone::auth': public_url => "${::openstack_integration::config::base_url}:9876", diff --git a/manifests/placement.pp b/manifests/placement.pp index d0d07a081..31ab3353f 100644 --- a/manifests/placement.pp +++ b/manifests/placement.pp @@ -19,6 +19,7 @@ class openstack_integration::placement { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'placement', + host => $::openstack_integration::config::host, } class { 'placement::keystone::auth': @@ -39,7 +40,14 @@ class openstack_integration::placement { debug => true, } class { 'placement::db': - database_connection => 'mysql+pymysql://placement:placement@127.0.0.1/placement?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'placement', + 'password' => 'placement', + 'database' => 'placement', + 'charset' => 'utf8', + }), } include placement::db::sync # TODO(tkajinam): Remove this once lp bug 1987984 is fixed. diff --git a/manifests/sahara.pp b/manifests/sahara.pp index a54287db3..28e4368d0 100644 --- a/manifests/sahara.pp +++ b/manifests/sahara.pp @@ -28,6 +28,7 @@ class openstack_integration::sahara ( charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'sahara', + host => $::openstack_integration::config::host, } class { 'sahara::keystone::auth': @@ -40,7 +41,14 @@ class openstack_integration::sahara ( debug => true, } class { 'sahara::db': - database_connection => 'mysql+pymysql://sahara:sahara@127.0.0.1/sahara?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'sahara', + 'password' => 'sahara', + 'database' => 'sahara', + 'charset' => 'utf8', + }), } class { 'sahara': host => $::openstack_integration::config::host, diff --git a/manifests/trove.pp b/manifests/trove.pp index 6e851a532..705573705 100644 --- a/manifests/trove.pp +++ b/manifests/trove.pp @@ -25,7 +25,14 @@ class openstack_integration::trove { debug => true, } class { 'trove::db': - database_connection => 'mysql+pymysql://trove:trove@127.0.0.1/trove?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'trove', + 'password' => 'trove', + 'database' => 'trove', + 'charset' => 'utf8', + }), } class { 'trove': default_transport_url => os_transport_url({ @@ -49,6 +56,7 @@ class openstack_integration::trove { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'trove', + host => $::openstack_integration::config::host, } class { 'trove::keystone::auth': password => 'a_big_secret', diff --git a/manifests/vitrage.pp b/manifests/vitrage.pp index df9e703b4..a9d2067ad 100644 --- a/manifests/vitrage.pp +++ b/manifests/vitrage.pp @@ -20,10 +20,18 @@ class openstack_integration::vitrage { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'vitrage', + host => $::openstack_integration::config::host, } class { 'vitrage::db': - database_connection => 'mysql+pymysql://vitrage:vitrage@127.0.0.1/vitrage?charset=utf8' + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'vitrage', + 'password' => 'vitrage', + 'database' => 'vitrage', + 'charset' => 'utf8', + }), } class { 'vitrage::db::sync': } diff --git a/manifests/watcher.pp b/manifests/watcher.pp index eed9d6d47..c4539b401 100644 --- a/manifests/watcher.pp +++ b/manifests/watcher.pp @@ -19,9 +19,17 @@ class openstack_integration::watcher { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'watcher', + host => $::openstack_integration::config::host, } class { 'watcher::db': - database_connection => 'mysql+pymysql://watcher:watcher@127.0.0.1/watcher?charset=utf8', + database_connection => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'watcher', + 'password' => 'watcher', + 'database' => 'watcher', + 'charset' => 'utf8', + }), } class { 'watcher::keystone::auth': password => 'a_big_secret', diff --git a/manifests/zaqar.pp b/manifests/zaqar.pp index 6ff0c3df9..ad37572f0 100644 --- a/manifests/zaqar.pp +++ b/manifests/zaqar.pp @@ -16,6 +16,7 @@ class openstack_integration::zaqar { charset => $::openstack_integration::params::mysql_charset, collate => $::openstack_integration::params::mysql_collate, password => 'zaqar', + host => $::openstack_integration::config::host, } class { 'zaqar::keystone::auth': password => 'a_big_secret', @@ -30,7 +31,15 @@ class openstack_integration::zaqar { admin_url => "ws://${::openstack_integration::config::ip_for_url}:8888", } class {'zaqar::management::sqlalchemy': - uri => 'mysql+pymysql://zaqar:zaqar@127.0.0.1/zaqar?charset=utf8', + uri => os_database_connection({ + 'dialect' => 'mysql+pymysql', + 'host' => $::openstack_integration::config::ip_for_url, + 'username' => 'zaqar', + 'password' => 'zaqar', + 'database' => 'zaqar', + 'charset' => 'utf8', + }), + } class {'zaqar::messaging::swift': auth_url => "${::openstack_integration::config::keystone_auth_uri}/v3",