diff --git a/lib/ansible/modules/cloud/azure/azure_rm_cosmosdbaccount.py b/lib/ansible/modules/cloud/azure/azure_rm_cosmosdbaccount.py index d76c928d131..9bdce05c857 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_cosmosdbaccount.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_cosmosdbaccount.py @@ -284,6 +284,9 @@ class AzureRMCosmosDBAccount(AzureRMModuleBase): id=dict( type='str', required=True + ), + ignore_missing_vnet_service_endpoint=dict( + type='bool' ) ) ), diff --git a/packaging/requirements/requirements-azure.txt b/packaging/requirements/requirements-azure.txt index 6bcc4ad21db..fbbc2d5d5f1 100644 --- a/packaging/requirements/requirements-azure.txt +++ b/packaging/requirements/requirements-azure.txt @@ -28,6 +28,6 @@ msrest==0.6.1 msrestazure==0.5.0 azure-keyvault==1.0.0a1 azure-graphrbac==0.40.0 -azure-mgmt-cosmosdb==0.5.1 +azure-mgmt-cosmosdb==0.5.2 azure-mgmt-hdinsight==0.1.0 azure-mgmt-devtestlabs==2.2.0 diff --git a/test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml b/test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml index f3cf68d738b..2335ce8f35d 100644 --- a/test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml +++ b/test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml @@ -1,8 +1,28 @@ - name: Prepare random number set_fact: dbname: "cosmos{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + vnname: "vn{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + subnetname: "subnet{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: yes +- name: Create virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ vnname }}" + address_prefixes_cidr: + - 10.1.0.0/16 + - 172.100.0.0/16 + dns_servers: + - 127.0.0.1 + - 127.0.0.3 + +- name: Add subnet + azure_rm_subnet: + name: "{{ subnetname }}" + virtual_network_name: "{{ vnname }}" + resource_group: "{{ resource_group }}" + address_prefix_cidr: "10.1.0.0/24" + - name: Create instance of Database Account -- check mode azure_rm_cosmosdbaccount: resource_group: "{{ resource_group }}" @@ -30,6 +50,13 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard + is_virtual_network_filter_enabled: yes + virtual_network_rules: + - subnet: + resource_group: "{{ resource_group }}" + virtual_network_name: "{{ vnname }}" + subnet_name: "{{ subnetname }}" + ignore_missing_vnet_service_endpoint: yes register: output - name: Assert the resource instance is well created assert: @@ -47,6 +74,13 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard + is_virtual_network_filter_enabled: yes + virtual_network_rules: + - subnet: + resource_group: "{{ resource_group }}" + virtual_network_name: "{{ vnname }}" + subnet_name: "{{ subnetname }}" + ignore_missing_vnet_service_endpoint: yes register: output - name: Assert the state has not changed assert: @@ -64,6 +98,13 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard + is_virtual_network_filter_enabled: yes + virtual_network_rules: + - subnet: + resource_group: "{{ resource_group }}" + virtual_network_name: "{{ vnname }}" + subnet_name: "{{ subnetname }}" + ignore_missing_vnet_service_endpoint: yes enable_automatic_failover: yes register: output - name: Assert the state has not changed diff --git a/test/runner/requirements/integration.cloud.azure.txt b/test/runner/requirements/integration.cloud.azure.txt index 6bcc4ad21db..fbbc2d5d5f1 100644 --- a/test/runner/requirements/integration.cloud.azure.txt +++ b/test/runner/requirements/integration.cloud.azure.txt @@ -28,6 +28,6 @@ msrest==0.6.1 msrestazure==0.5.0 azure-keyvault==1.0.0a1 azure-graphrbac==0.40.0 -azure-mgmt-cosmosdb==0.5.1 +azure-mgmt-cosmosdb==0.5.2 azure-mgmt-hdinsight==0.1.0 azure-mgmt-devtestlabs==2.2.0