mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Adding check_state support and warning
lint Update integration test handle check_mode handle warnings Removing the empty tags check Updating author handle To use github handle Changing from warn to fail disabled tests
This commit is contained in:
parent
472d3c3c86
commit
d9ee3c09ca
3 changed files with 105 additions and 24 deletions
|
@ -1,4 +1,2 @@
|
|||
cloud/azure
|
||||
posix/ci/cloud/azure
|
||||
posix/ci/cloud/smoketest
|
||||
destructive
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
resource_group: "{{ resource_group }}"
|
||||
tags:
|
||||
tag1: testtag
|
||||
register: output
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that: output.changed
|
||||
that: results.changed
|
||||
|
||||
- name: Create an availability set with advanced options
|
||||
azure_rm_availabilityset:
|
||||
|
@ -16,22 +16,41 @@
|
|||
platform_update_domain_count: 5
|
||||
platform_fault_domain_count: 2
|
||||
sku: Aligned
|
||||
register: output
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that: output.changed
|
||||
that: results.changed
|
||||
|
||||
- name: Attempt to modify availabilty set options (we don't support modify so no changes)
|
||||
- name: Modify availabilty set immutable options - no changes, issue warning
|
||||
azure_rm_availabilityset:
|
||||
name: myavailabilityset2
|
||||
resource_group: "{{ resource_group }}"
|
||||
platform_update_domain_count: 2
|
||||
platform_fault_domain_count: 2
|
||||
sku: Aligned
|
||||
register: output
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that: not output.changed
|
||||
that:
|
||||
- not results.changed
|
||||
- results.warnings[0] == 'You tried to change platform_update_domain_count but is was unsuccessful'
|
||||
|
||||
- name: Modify availabilty set immutable options and set tags - change tags and issue warning for immutable options
|
||||
azure_rm_availabilityset:
|
||||
name: myavailabilityset2
|
||||
resource_group: "{{ resource_group }}"
|
||||
platform_update_domain_count: 2
|
||||
platform_fault_domain_count: 2
|
||||
sku: Aligned
|
||||
tags:
|
||||
test1: modified
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- results.changed
|
||||
- results.state.tags.test1 == 'modified'
|
||||
- results.warnings[0] == 'You tried to change platform_update_domain_count but is was unsuccessful'
|
||||
|
||||
- name: Modify availabilty set options to update tags
|
||||
azure_rm_availabilityset:
|
||||
|
@ -41,12 +60,12 @@
|
|||
platform_fault_domain_count: 2
|
||||
sku: Aligned
|
||||
tags:
|
||||
test: modified
|
||||
register: output
|
||||
test2: modified
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "output.state.tags.test == 'modified'"
|
||||
- results.state.tags.test2 == 'modified'
|
||||
|
||||
- name: Create availability set with incorrect fault domain parameter
|
||||
azure_rm_availabilityset:
|
||||
|
@ -55,11 +74,29 @@
|
|||
platform_update_domain_count: 5
|
||||
platform_fault_domain_count: 4
|
||||
sku: Aligned
|
||||
register: output
|
||||
register: results
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
{ that: "'The specified fault domain count 4 must fall in the range 1 to' in output['msg']" }
|
||||
{ that: "'The specified fault domain count 4 must fall in the range 1 to' in results['msg']" }
|
||||
|
||||
- name: Test check_mode
|
||||
azure_rm_availabilityset:
|
||||
name: myavailabilityset2
|
||||
resource_group: "{{ resource_group }}"
|
||||
platform_update_domain_count: 5
|
||||
platform_fault_domain_count: 2
|
||||
sku: Aligned
|
||||
tags:
|
||||
checktest1: modified1
|
||||
checktest2: modified2
|
||||
check_mode: yes
|
||||
register: results
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- not results.changed
|
||||
- results.state.tags.checktest1 == 'modified1'
|
||||
|
||||
- name: Delete an availability set
|
||||
azure_rm_availabilityset:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue