diff --git a/doc/source/install/manual.rst b/doc/source/install/manual.rst index b7e5dec82..c7ad2894c 100644 --- a/doc/source/install/manual.rst +++ b/doc/source/install/manual.rst @@ -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 diff --git a/meta/io.murano/Classes/resources/NeutronNetwork.yaml b/meta/io.murano/Classes/resources/NeutronNetwork.yaml index 06434b9dd..78ec13eb2 100644 --- a/meta/io.murano/Classes/resources/NeutronNetwork.yaml +++ b/meta/io.murano/Classes/resources/NeutronNetwork.yaml @@ -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 diff --git a/murano/common/config.py b/murano/common/config.py index 7f29c3e6a..864878057 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -162,9 +162,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 ' diff --git a/murano/tests/unit/policy/expected_rules_wordpress.txt b/murano/tests/unit/policy/expected_rules_wordpress.txt index 19bb8f54f..0b9b93ea6 100644 --- a/murano/tests/unit/policy/expected_rules_wordpress.txt +++ b/murano/tests/unit/policy/expected_rules_wordpress.txt @@ -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") diff --git a/murano/tests/unit/policy/model_complex.yaml b/murano/tests/unit/policy/model_complex.yaml index 64213b82f..88d7c1108 100644 --- a/murano/tests/unit/policy/model_complex.yaml +++ b/murano/tests/unit/policy/model_complex.yaml @@ -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 \ No newline at end of file diff --git a/murano/tests/unit/policy/wordpress.yaml b/murano/tests/unit/policy/wordpress.yaml index 20f3f9be6..166e33bfd 100644 --- a/murano/tests/unit/policy/wordpress.yaml +++ b/murano/tests/unit/policy/wordpress.yaml @@ -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}