mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
d252cc7a2b
* 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
107 lines
2.8 KiB
YAML
107 lines
2.8 KiB
YAML
- 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
|