[PRD-1782] add custom dns support to nova::network

This commit is contained in:
Vladimir Kuklin 2013-09-27 19:51:35 +04:00
parent 4f6f75dd05
commit 64f333afa6
9 changed files with 42 additions and 28 deletions

View File

@ -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

View File

@ -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]
}
}

View File

@ -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':

View File

@ -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,

View File

@ -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':

View File

@ -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',

View File

@ -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":

View File

@ -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 {

View File

@ -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 }