Merge pull request #585 from Mirantis/prd1782

[PRD-1782] Allow configuration of custom DNS servers through UI/ Nova-manifests part
This commit is contained in:
Vladimir Kuklin 2013-10-07 11:46:09 -07:00
commit 6ac62d9d06
12 changed files with 39 additions and 22 deletions

View File

@ -3,3 +3,5 @@ pkg/
.DS_Store
metadata.json
coverage/
spec/fixtures

View File

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

View File

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

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

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

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

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

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

View File

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

View File

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

View File

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