mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
adding cosmos db account module (#47181)
* adding cosmos db account module * fixes * fixed issues * cosmos db account test fixes * updating cosmosdb * fixed required * version from autogereneator * several upgrades * idempotency changes * idempotency improvements * updated cosmos db module with new idempotency check * and idempotency check shall fail now.... * try to fail it again * now should really fail * one more * introducing comparison template * fixes + sorting of arrays * updated comparisons * don't compare if parameter is none * one more test * fixed compare * fixed idempotency? * more logging * fix comparison rules * make smaller change * actually compare multiple write locations * just change failover * remove debugging stuff * one more fix * fixed remaining sanity test * updating comparison stuff * fix pep8 * fix pep8 * will pep8 finally work? * one more fix * cosmos db updates * updating cosmos db account * fixed pep8 * fix type * fixed indent * fixed problem with python 3 * another fix for python 3 * bool type here * cosmos db fixes * fix * fix * fix * fixed syntax
This commit is contained in:
committed by
Matt Davis
parent
0ec4e0a842
commit
d252cc7a2b
@@ -0,0 +1,3 @@
|
||||
cloud/azure
|
||||
destructive
|
||||
shippable/azure/group1
|
||||
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- setup_azure
|
||||
107
test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml
Normal file
107
test/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml
Normal file
@@ -0,0 +1,107 @@
|
||||
- name: Prepare random number
|
||||
set_fact:
|
||||
dbname: "cosmos{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
||||
run_once: yes
|
||||
|
||||
- name: Create instance of Database Account -- check mode
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
location: eastus
|
||||
geo_rep_locations:
|
||||
- name: eastus
|
||||
failover_priority: 0
|
||||
database_account_offer_type: Standard
|
||||
check_mode: yes
|
||||
register: output
|
||||
- name: Assert the resource instance is well created
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
|
||||
- name: Create instance of Database Account
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
location: eastus
|
||||
geo_rep_locations:
|
||||
- name: eastus
|
||||
failover_priority: 0
|
||||
- name: westus
|
||||
failover_priority: 1
|
||||
database_account_offer_type: Standard
|
||||
register: output
|
||||
- name: Assert the resource instance is well created
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
|
||||
- name: Create again instance of Database Account
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
location: eastus
|
||||
geo_rep_locations:
|
||||
- name: eastus
|
||||
failover_priority: 0
|
||||
- name: westus
|
||||
failover_priority: 1
|
||||
database_account_offer_type: Standard
|
||||
register: output
|
||||
- name: Assert the state has not changed
|
||||
assert:
|
||||
that:
|
||||
- output.changed == false
|
||||
|
||||
- name: Create again instance of Database Account -- change something
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
location: eastus
|
||||
geo_rep_locations:
|
||||
- name: eastus
|
||||
failover_priority: 0
|
||||
- name: westus
|
||||
failover_priority: 1
|
||||
database_account_offer_type: Standard
|
||||
enable_automatic_failover: yes
|
||||
register: output
|
||||
- name: Assert the state has not changed
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
|
||||
- name: Delete instance of Database Account -- check mode
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
state: absent
|
||||
check_mode: yes
|
||||
register: output
|
||||
- name: Assert the state has changed
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
|
||||
- name: Delete instance of Database Account
|
||||
azure_rm_cosmosdbaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ dbname }}"
|
||||
state: absent
|
||||
register: output
|
||||
- name: Assert the state has changed
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
|
||||
# currently disabled as there's a bug in SDK / Service
|
||||
#- name: Delete unexisting instance of Database Account
|
||||
# azure_rm_cosmosdbaccount:
|
||||
# resource_group: "{{ resource_group }}"
|
||||
# name: "{{ dbname }}"
|
||||
# state: absent
|
||||
# register: output
|
||||
#- name: Assert the state has changed
|
||||
# assert:
|
||||
# that:
|
||||
# - output.changed == false
|
||||
Reference in New Issue
Block a user