Fixes #39648 azure_rm_virtualnetwork not handling DNS settings properly on existing virtual networks (#40646)
* check nullable * add test * fix * fix
This commit is contained in:
parent
dde48560fb
commit
7b9864776a
2 changed files with 12 additions and 1 deletions
|
@ -257,7 +257,7 @@ class AzureRMVirtualNetwork(AzureRMModuleBase):
|
|||
changed = True
|
||||
|
||||
if self.dns_servers:
|
||||
existing_dns_set = set(vnet.dhcp_options.dns_servers)
|
||||
existing_dns_set = set(vnet.dhcp_options.dns_servers) if vnet.dhcp_options else set([])
|
||||
requested_dns_set = set(self.dns_servers)
|
||||
if existing_dns_set != requested_dns_set:
|
||||
self.log('CHANGED: replacing DNS servers')
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
resource_group: "{{ resource_group }}"
|
||||
state: absent
|
||||
|
||||
- name: Create virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
name: my_test_network
|
||||
address_prefixes_cidr:
|
||||
- 10.1.0.0/16
|
||||
- 172.100.0.0/16
|
||||
tags:
|
||||
testing: testing
|
||||
delete: on-exit
|
||||
resource_group: "{{ resource_group }}"
|
||||
|
||||
- name: Create virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
name: my_test_network
|
||||
|
|
Loading…
Reference in a new issue