Remove hardcoded dns from config file

If no nameserver list is provided to a neutron subnet,
it uses the DHCP (gateway) address which in turn forwards to dnsmasq.

So dns_nameservers will be set to emptylist in heat templete.

In case user wants to set different dns from default,
he may edit the config parameter, witch is not removed.
The name of parameters is changes to dns_nameservers (with s at the end)
to correspond the same name in heat template.

Change-Id: Iba8b12b8bc78f821e11debb58f20cb713a9dc9c7
Closes-Bug: #1367877
This commit is contained in:
Ekaterina Chernova 2015-02-12 19:31:48 +03:00
parent e1c468a489
commit ff9c0c49ea
6 changed files with 16 additions and 18 deletions
doc/source/install
meta/io.murano/Classes/resources
murano

View File

@ -192,6 +192,10 @@ Install the API service and Engine
login = %RABBITMQ_USER%
password = %RABBITMQ_PASSWORD%
virtual_host = %RABBITMQ_SERVER_VIRTUAL_HOST%
[networking]
default_dns = 8.8.8.8 # In case openstack neutron has no default
# DNS configured
..
#. Create a virtual environment and install Murano prerequisites. We will use

View File

@ -27,14 +27,12 @@ Properties:
Contract: $.string()
Usage: InOut
dnsNameserver:
Contract: $.string()
dnsNameservers:
# This property is optional,
# since neutron default dns will be used in case of empty
Contract: [$.string()]
Usage: InOut
useDefaultDns:
Contract: $.bool().notNull()
Default: true
Methods:
initialize:
Body:
@ -46,10 +44,9 @@ Methods:
Body:
- If: not $.getAttr(deployed, false)
Then:
- If: $.useDefaultDns and (not bool($.dnsNameserver))
- If: $.dnsNameservers = null
Then:
- $.dnsNameserver: $._netExplorer.getDefaultDns()
- $.dnsNameservers: $._netExplorer.getDefaultDns()
- $template: $._createNetwork()
- If: $.autoUplink and (not bool($.externalRouterId))
Then:
@ -87,7 +84,7 @@ Methods:
properties:
network: { get_resource: $._getNetworkName() }
ip_version: 4
dns_nameservers: [ $.dnsNameserver ]
dns_nameservers: $.dnsNameservers
cidr: $.subnetCidr

View File

@ -166,9 +166,9 @@ networking_opts = [
help='Template IP address for generating environment '
'subnet cidrs'),
cfg.StrOpt('default_dns', default='8.8.8.8',
help='Default DNS nameserver to be assigned to '
'created Networks'),
cfg.ListOpt('default_dns', default=[],
help='List of default DNS nameservers to be assigned to '
'created Networks'),
cfg.StrOpt('external_network', default='ext-net',
help='ID or name of the external network for routers '

View File

@ -2,7 +2,6 @@ murano:objects+("83bff5acf8354816b08cf9b4917c898d", "de305d5475b4431badb2eb6b9e5
murano:properties+("83bff5acf8354816b08cf9b4917c898d", "name", "wordpress-env")
murano:parent_types+("83bff5acf8354816b08cf9b4917c898d", "io.murano.Object")
murano:objects+("c46770dec1db483ca2322914b842e50f", "83bff5acf8354816b08cf9b4917c898d", "io.murano.resources.NeutronNetwork")
murano:properties+("c46770dec1db483ca2322914b842e50f", "useDefaultDns", "True")
murano:properties+("c46770dec1db483ca2322914b842e50f", "name", "wordpress-env-network")
murano:properties+("c46770dec1db483ca2322914b842e50f", "autogenerateSubnet", "True")
murano:properties+("c46770dec1db483ca2322914b842e50f", "autoUplink", "True")

View File

@ -44,10 +44,9 @@ defaultNetworks:
'?': {id: 7bac482a4c194b6e8dea81e6ce606db6, type: io.murano.resources.NeutronNetwork}
autoUplink: true
autogenerateSubnet: true
dnsNameserver: null
dnsNameservers: null
externalRouterId: null
name: quick-env-12-network
subnetCidr: null
useDefaultDns: true
flat: null
name: quick-env-12

View File

@ -3,11 +3,10 @@ defaultNetworks:
'?': {id: c46770dec1db483ca2322914b842e50f, type: io.murano.resources.NeutronNetwork}
autoUplink: true
autogenerateSubnet: true
dnsNameserver: null
dnsNameservers: null
externalRouterId: null
name: wordpress-env-network
subnetCidr: null
useDefaultDns: true
flat: null
name: wordpress-env
'?': {type: io.murano.Environment, id: 83bff5acf8354816b08cf9b4917c898d}