From 613235b72191c718b45b07d3c955d5aa5496a23f Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Fri, 27 Sep 2013 18:57:49 +0400 Subject: [PATCH 1/4] [PRD-1782] add options for dns1 in providers --- .../nova/lib/puppet/provider/nova_network/nova_manage.rb | 5 +---- deployment/puppet/nova/lib/puppet/type/nova_network.rb | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) 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..e2e6db064b 100644 --- a/deployment/puppet/nova/lib/puppet/type/nova_network.rb +++ b/deployment/puppet/nova/lib/puppet/type/nova_network.rb @@ -35,6 +35,9 @@ Puppet::Type.newtype(:nova_network) do newparam(:gateway) do end + newparam(:dns1) do + end + newparam(:dns2) do end From 4f6f75dd055d832be87e3e0a3de68d82c9fe98ac Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Fri, 27 Sep 2013 18:58:38 +0400 Subject: [PATCH 2/4] update .gitignore --- deployment/puppet/nova/.gitignore | 2 ++ 1 file changed, 2 insertions(+) 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 + From 64f333afa6ce4a9d745121ec4a802408de722438 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Fri, 27 Sep 2013 19:51:35 +0400 Subject: [PATCH 3/4] [PRD-1782] add custom dns support to nova::network --- .../nova/lib/puppet/type/nova_network.rb | 2 ++ .../puppet/nova/manifests/manage/network.pp | 6 +++-- deployment/puppet/nova/manifests/network.pp | 12 +++++---- .../puppet/openstack/manifests/controller.pp | 2 ++ .../openstack/manifests/controller_ha.pp | 20 ++++++++------- .../openstack/manifests/nova/controller.pp | 1 + .../osnailyfacter/manifests/cluster_ha.pp | 25 ++++++++++--------- .../manifests/cluster_ha_full.pp | 1 + .../osnailyfacter/manifests/cluster_simple.pp | 1 + 9 files changed, 42 insertions(+), 28 deletions(-) diff --git a/deployment/puppet/nova/lib/puppet/type/nova_network.rb b/deployment/puppet/nova/lib/puppet/type/nova_network.rb index e2e6db064b..13a9cacbaf 100644 --- a/deployment/puppet/nova/lib/puppet/type/nova_network.rb +++ b/deployment/puppet/nova/lib/puppet/type/nova_network.rb @@ -36,9 +36,11 @@ Puppet::Type.newtype(:nova_network) 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 838386ee08..4973c501c7 100644 --- a/deployment/puppet/openstack/manifests/controller.pp +++ b/deployment/puppet/openstack/manifests/controller.pp @@ -188,6 +188,7 @@ class openstack::controller ( $nova_rate_limits = undef, $cinder_rate_limits = undef, $ha_mode = false, + $nameservers = undef, ) { @@ -319,6 +320,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 f77110c180..07d723e5cc 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 @@ -321,17 +322,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/manifests/cluster_ha.pp b/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp index 83e082a3f2..f0a593597b 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_ha.pp @@ -209,15 +209,15 @@ class compact_controller ( internal_virtual_ip => $management_vip, public_virtual_ip => $public_vip, primary_controller => $primary_controller, - floating_range => $::use_quantum ? { true=>$floating_hash, default=>false}, + floating_range => $::use_quantum ? { true => $floating_hash, default => false}, fixed_range => $fixed_network_range, multi_host => $multi_host, network_manager => $network_manager, 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], @@ -261,15 +261,16 @@ class compact_controller ( mysql_skip_name_resolve => true, use_syslog => true, 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_quantum => $syslog_log_facility_quantum, - syslog_log_facility_nova => $syslog_log_facility_nova, - syslog_log_facility_keystone => $syslog_log_facility_keystone, - nova_rate_limits => $nova_rate_limits, - cinder_rate_limits => $cinder_rate_limits, - horizon_use_ssl => $::horizon_use_ssl, - use_unicast_corosync => $::use_unicast_corosync, + syslog_log_facility_glance => $syslog_log_facility_glance, + syslog_log_facility_cinder => $syslog_log_facility_cinder, + syslog_log_facility_quantum => $syslog_log_facility_quantum, + syslog_log_facility_nova => $syslog_log_facility_nova, + syslog_log_facility_keystone => $syslog_log_facility_keystone, + nova_rate_limits => $nova_rate_limits, + cinder_rate_limits => $cinder_rate_limits, + horizon_use_ssl => $::horizon_use_ssl, + use_unicast_corosync => $::use_unicast_corosync, + nameservers => $::dns_nameservers, } # class { "::rsyslog::client": diff --git a/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp b/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp index ccc7942a47..e3604e1df0 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_ha_full.pp @@ -263,6 +263,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 c5760172c9..d31177e41c 100644 --- a/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp +++ b/deployment/puppet/osnailyfacter/manifests/cluster_simple.pp @@ -191,6 +191,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 => $start_guests_on_host_boot } nova_config { 'DEFAULT/use_cow_images': value => $use_cow_images } From f6775a8e68d27e7572a0f5eb573cb55383b063a7 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Mon, 7 Oct 2013 15:26:38 +0400 Subject: [PATCH 4/4] Rebase on single yaml --- deployment/puppet/osnailyfacter/examples/site.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/deployment/puppet/osnailyfacter/examples/site.pp b/deployment/puppet/osnailyfacter/examples/site.pp index a7bd941378..923e386725 100644 --- a/deployment/puppet/osnailyfacter/examples/site.pp +++ b/deployment/puppet/osnailyfacter/examples/site.pp @@ -26,6 +26,7 @@ stage {'glance-image': if $nodes != undef { $nodes_hash = parsejson($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")