mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Clean up and migrate Azure tests. (#28103)
* Remove placeholder Azure test. * Migrate Azure tests to ansible-test. * Initial cleanup on remaining legacy Azure tests.
This commit is contained in:
parent
ac56a2f138
commit
3631163329
23 changed files with 264 additions and 638 deletions
95
test/integration/targets/azure_rm_subnet/tasks/main.yml
Normal file
95
test/integration/targets/azure_rm_subnet/tasks/main.yml
Normal file
|
@ -0,0 +1,95 @@
|
|||
- name: Create virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
name: My_Virtual_Network
|
||||
address_prefixes_cidr:
|
||||
- 10.1.0.0/16
|
||||
- 172.100.0.0/16
|
||||
dns_servers:
|
||||
- 127.0.0.1
|
||||
- 127.0.0.3
|
||||
tags:
|
||||
testing: testing
|
||||
delete: on-exit
|
||||
resource_group: "{{ resource_group }}"
|
||||
|
||||
- name: Remove subnet
|
||||
azure_rm_subnet:
|
||||
state: absent
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
|
||||
- name: Catch invalid cidr
|
||||
azure_rm_subnet:
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
address_prefix_cidr: "10.1.0/24"
|
||||
register: output
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that: output.failed
|
||||
|
||||
- name: Add the subnet back
|
||||
azure_rm_subnet:
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
address_prefix_cidr: "10.1.0.0/24"
|
||||
register: output
|
||||
|
||||
- assert:
|
||||
that: output.changed
|
||||
|
||||
- name: Create network security group
|
||||
azure_rm_securitygroup:
|
||||
name: secgroupfoo
|
||||
resource_group: "{{ resource_group }}"
|
||||
tags:
|
||||
testing: testing
|
||||
|
||||
- name: Update the subnet
|
||||
azure_rm_subnet:
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
address_prefix_cidr: "10.1.0.0/16"
|
||||
security_group: secgroupfoo
|
||||
tags:
|
||||
testing: testing
|
||||
delete: on-fini
|
||||
|
||||
- name: Should be idempotent
|
||||
azure_rm_subnet:
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
address_prefix_cidr: "10.1.0.0/16"
|
||||
security_group: secgroupfoo
|
||||
tags:
|
||||
testing: testing
|
||||
delete: on-fini
|
||||
register: output
|
||||
|
||||
- assert:
|
||||
that: not output.changed
|
||||
|
||||
- name: Remove subnet
|
||||
azure_rm_subnet:
|
||||
state: absent
|
||||
name: foobar
|
||||
virtual_network_name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
|
||||
- name: Remove security group
|
||||
azure_rm_securitygroup:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: secgroupfoo
|
||||
state: absent
|
||||
|
||||
- name: Remove virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
name: My_Virtual_Network
|
||||
resource_group: "{{ resource_group }}"
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue