diff --git a/deployment/puppet/nova/.gitignore b/deployment/puppet/nova/.gitignore index b2f81173c6..0150304655 100644 --- a/deployment/puppet/nova/.gitignore +++ b/deployment/puppet/nova/.gitignore @@ -3,3 +3,5 @@ pkg/ .DS_Store metadata.json coverage/ +spec/fixtures + diff --git a/deployment/puppet/nova/lib/puppet/provider/nova_network/nova_manage.rb b/deployment/puppet/nova/lib/puppet/provider/nova_network/nova_manage.rb index 6209c81917..54f43c5a7c 100644 --- a/deployment/puppet/nova/lib/puppet/provider/nova_network/nova_manage.rb +++ b/deployment/puppet/nova/lib/puppet/provider/nova_network/nova_manage.rb @@ -29,6 +29,7 @@ Puppet::Type.type(:nova_network).provide(:nova_manage) do { # this needs to be converted from a project name to an id :project => '--project_id', + :dns1 => '--dns1', :dns2 => '--dns2', :gateway => '--gateway', :bridge => '--bridge', @@ -39,10 +40,6 @@ Puppet::Type.type(:nova_network).provide(:nova_manage) do end end - # if resource[:network_size].to_i <= 2**(32-resource[:name].split('/')[1].to_i)-1 - # optional_opts.push('--network_size').push(resource[:network_size]) - # end - nova_manage('network', 'create', resource[:label], resource[:name], diff --git a/deployment/puppet/nova/lib/puppet/type/nova_network.rb b/deployment/puppet/nova/lib/puppet/type/nova_network.rb index 26f4a8f42a..13a9cacbaf 100644 --- a/deployment/puppet/nova/lib/puppet/type/nova_network.rb +++ b/deployment/puppet/nova/lib/puppet/type/nova_network.rb @@ -35,7 +35,12 @@ Puppet::Type.newtype(:nova_network) do newparam(:gateway) do end + newparam(:dns1) do + desc 'first dns server' + end + newparam(:dns2) do + desc 'second dns server' end newparam(:vlan_start) do diff --git a/deployment/puppet/nova/manifests/manage/network.pp b/deployment/puppet/nova/manifests/manage/network.pp index 16fb907f9e..971cc00fa2 100644 --- a/deployment/puppet/nova/manifests/manage/network.pp +++ b/deployment/puppet/nova/manifests/manage/network.pp @@ -10,7 +10,8 @@ define nova::manage::network ( $num_networks = 1, $network_size = 255, $vlan_start = undef, - $project = undef + $project = undef, + $nameservers = ['8.8.8.8','8.8.4.4'] ) { File['/etc/nova/nova.conf'] -> Nova_network[$name] @@ -23,6 +24,7 @@ define nova::manage::network ( network_size => $network_size, project => $project, vlan_start => $vlan_start, + dns1 => $nameservers[0], + dns2 => $nameservers[1] } - } diff --git a/deployment/puppet/nova/manifests/network.pp b/deployment/puppet/nova/manifests/network.pp index 8d850148b2..54854da172 100644 --- a/deployment/puppet/nova/manifests/network.pp +++ b/deployment/puppet/nova/manifests/network.pp @@ -23,7 +23,8 @@ class nova::network( $config_overrides = {}, $create_networks = true, $ensure_package = 'present', - $install_service = true + $install_service = true, + $nameservers = ['8.8.8.8','8.8.4.4'] ) { include nova::params @@ -64,10 +65,11 @@ class nova::network( if $create_networks { nova::manage::network { 'nova-vm-net': - network => $fixed_range, - num_networks => $num_networks, - network_size => $network_size, - vlan_start => $vlan_start, + network => $fixed_range, + num_networks => $num_networks, + network_size => $network_size, + nameservers => $nameservers, + vlan_start => $vlan_start, } if $floating_range { nova::manage::floating { 'nova-vm-floating': diff --git a/deployment/puppet/openstack/manifests/controller.pp b/deployment/puppet/openstack/manifests/controller.pp index 1b1803d223..176a64fb04 100644 --- a/deployment/puppet/openstack/manifests/controller.pp +++ b/deployment/puppet/openstack/manifests/controller.pp @@ -189,6 +189,7 @@ class openstack::controller ( $nova_rate_limits = undef, $cinder_rate_limits = undef, $ha_mode = false, + $nameservers = undef, ) { @@ -318,6 +319,7 @@ class openstack::controller ( # Database db_host => $db_host, # Network + nameservers => $nameservers, network_manager => $network_manager, floating_range => $floating_range, fixed_range => $fixed_range, diff --git a/deployment/puppet/openstack/manifests/controller_ha.pp b/deployment/puppet/openstack/manifests/controller_ha.pp index 929f36bc0d..4115f38f02 100644 --- a/deployment/puppet/openstack/manifests/controller_ha.pp +++ b/deployment/puppet/openstack/manifests/controller_ha.pp @@ -139,6 +139,7 @@ class openstack::controller_ha ( $quantum_metadata_proxy_shared_secret = 'shared_secret', $use_unicast_corosync = false, $ha_mode = true, + $nameservers = undef, ) { # haproxy @@ -322,17 +323,18 @@ class openstack::controller_ha ( nv_physical_volume => $nv_physical_volume, cinder_volume_group => $cinder_volume_group, # turn on SWIFT_ENABLED option for Horizon dashboard - swift => $glance_backend ? { 'swift' => true, default => false }, - use_syslog => $use_syslog, - syslog_log_level => $syslog_log_level, + swift => $glance_backend ? { 'swift' => true, default => false }, + use_syslog => $use_syslog, + syslog_log_level => $syslog_log_level, syslog_log_facility_glance => $syslog_log_facility_glance, - syslog_log_facility_cinder => $syslog_log_facility_cinder, - syslog_log_facility_nova => $syslog_log_facility_nova, + syslog_log_facility_cinder => $syslog_log_facility_cinder, + syslog_log_facility_nova => $syslog_log_facility_nova, syslog_log_facility_keystone => $syslog_log_facility_keystone, - cinder_rate_limits => $cinder_rate_limits, - nova_rate_limits => $nova_rate_limits, - horizon_use_ssl => $horizon_use_ssl, - ha_mode => $ha_mode, + cinder_rate_limits => $cinder_rate_limits, + nova_rate_limits => $nova_rate_limits, + horizon_use_ssl => $horizon_use_ssl, + ha_mode => $ha_mode, + nameservers => $nameservers, } if $quantum and $quantum_network_node { class { '::openstack::quantum_router': diff --git a/deployment/puppet/openstack/manifests/nova/controller.pp b/deployment/puppet/openstack/manifests/nova/controller.pp index b85525858e..a7c3bf3bc7 100644 --- a/deployment/puppet/openstack/manifests/nova/controller.pp +++ b/deployment/puppet/openstack/manifests/nova/controller.pp @@ -86,6 +86,7 @@ class openstack::nova::controller ( $rabbit_nodes = [$internal_address], $rabbit_cluster = false, $rabbit_ha_virtual_ip = false, + $nameservers = undef, $ensure_package = present, $enabled_apis = 'ec2,osapi_compute', $api_bind_address = '0.0.0.0', diff --git a/deployment/puppet/osnailyfacter/examples/site.pp b/deployment/puppet/osnailyfacter/examples/site.pp index 68007cdb1c..be7d1a18e0 100644 --- a/deployment/puppet/osnailyfacter/examples/site.pp +++ b/deployment/puppet/osnailyfacter/examples/site.pp @@ -26,6 +26,7 @@ stage {'glance-image': if $::fuel_settings['nodes'] { $nodes_hash = $::fuel_settings['nodes'] + $dns_nameservers=$::fuel_settings['dns_nameservers'] $node = filter_nodes($nodes_hash,'name',$::hostname) if empty($node) { fail("Node $::hostname is not defined in the hash structure") diff --git a/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp b/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp index 280ceeb493..8461a8d09f 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp @@ -221,8 +221,8 @@ class compact_controller ( num_networks => $num_networks, network_size => $network_size, network_config => $network_config, - debug => $debug ? { 'true' => true, true => true, default=> false }, - verbose => $verbose ? { 'true' => true, true => true, default=> false }, + debug => $debug ? { 'true' => true, true => true, default => false }, + verbose => $verbose ? { 'true' => true, true => true, default => false }, queue_provider => $::queue_provider, qpid_password => $rabbit_hash[password], qpid_user => $rabbit_hash[user], @@ -271,6 +271,7 @@ class compact_controller ( cinder_rate_limits => $cinder_rate_limits, horizon_use_ssl => $::fuel_settings['horizon_use_ssl'], use_unicast_corosync => $::fuel_settings['use_unicast_corosync'], + nameservers => $::dns_nameservers, } diff --git a/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp b/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp index e9747e3cae..145e911c4c 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp @@ -258,6 +258,7 @@ class ha_controller ( cinder_rate_limits => $cinder_rate_limits, horizon_use_ssl => $::horizon_use_ssl, use_unicast_corosync => $::use_unicast_corosync, + nameservers => $::dns_nameservers, } if $primary_controller { diff --git a/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp b/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp index 5f5a29fcdb..8dd07fe9d2 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp @@ -202,6 +202,7 @@ if ($use_ceph) { syslog_log_facility_keystone => $syslog_log_facility_keystone, cinder_rate_limits => $cinder_rate_limits, horizon_use_ssl => $horizon_use_ssl, + nameservers => $::dns_nameservers, } nova_config { 'DEFAULT/start_guests_on_host_boot': value => $::fuel_settings['start_guests_on_host_boot'] } nova_config { 'DEFAULT/use_cow_images': value => $::fuel_settings['use_cow_images'] }