1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixing three unstable integration tests (#40804)

This commit is contained in:
Zim Kalinowski 2018-05-29 14:22:59 +08:00 committed by Yunge Zhu
parent 1645db3cee
commit 8544bc5b2a
6 changed files with 61 additions and 46 deletions

View file

@ -1,4 +1,3 @@
cloud/azure
posix/ci/cloud/group3/azure
unstable
destructive

View file

@ -1,26 +1,34 @@
- name: Prepare random number
set_fact:
pipaname: "pipa{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
pipbname: "pipb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
lbname: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
lbvnname: "lbvn{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
run_once: yes
- name: create public ip
azure_rm_publicipaddress:
name: ansiblepipstandard
name: "{{ pipbname }}"
sku: Standard
allocation_method: Static
resource_group: '{{ resource_group }}'
- name: create public ip
azure_rm_publicipaddress:
name: ansiblepip3
name: "{{ pipaname }}"
resource_group: '{{ resource_group }}'
- name: clear load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
- name: create load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
public_ip: ansiblepip3
name: "{{ lbname }}"
public_ip: "{{ pipaname }}"
register: output
- name: assert load balancer created
@ -30,7 +38,7 @@
- name: delete load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
register: output
@ -41,7 +49,7 @@
- name: delete load balancer (idempotent)
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
register: output
@ -52,9 +60,9 @@
- name: create another load balancer with more options
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
sku: Standard
public_ip_address: ansiblepipstandard
public_ip_address: "{{ pipbname }}"
probe_protocol: Tcp
probe_port: 80
probe_interval: 10
@ -79,16 +87,16 @@
- name: delete load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
- name: create load balancer with multiple parameters
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
frontend_ip_configurations:
- name: frontendipconf0
public_ip_address: ansiblepip3
public_ip_address: "{{ pipaname }}"
backend_address_pools:
- name: backendaddrpool0
probes:
@ -117,27 +125,27 @@
- name: delete load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
- name: Create virtual network
azure_rm_virtualnetwork:
resource_group: "{{ resource_group }}"
name: lbtestfromansiblevn
name: "{{ lbvnname }}"
address_prefixes: "10.10.0.0/16"
- name: Add subnet
azure_rm_subnet:
resource_group: "{{ resource_group }}"
name: lbtestfromansiblesb
name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb"
address_prefix: "10.10.0.0/24"
virtual_network: lbtestfromansiblevn
virtual_network: "{{ lbvnname }}"
register: subnet
- name: create internal loadbalancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
frontend_ip_configurations:
- name: frontendipconf0
private_ip_address: 10.10.0.10
@ -171,7 +179,7 @@
- name: delete load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
name: lbtestfromansible
name: "{{ lbname }}"
state: absent
- name: cleanup public ip
@ -180,18 +188,18 @@
resource_group: '{{ resource_group }}'
state: absent
with_items:
- ansiblepip3
- ansiblepipstandard
- "{{ pipaname }}"
- "{{ pipbname }}"
- name: cleanup subnet
azure_rm_subnet:
resource_group: "{{ resource_group }}"
name: lbtestfromansiblesb
virtual_network: lbtestfromansiblevn
name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb"
virtual_network: "{{ lbvnname }}"
state: absent
- name: cleanup virtual network
azure_rm_virtualnetwork:
resource_group: "{{ resource_group }}"
name: lbtestfromansiblevn
name: "{{ lbvnname }}"
state: absent

View file

@ -1,5 +1,4 @@
cloud/azure
posix/ci/cloud/group2/azure
unstable
destructive
azure_rm_securitygroup_facts

View file

@ -1,7 +1,13 @@
- name: Prepare random number
set_fact:
secgroupname: "sg{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
run_once: yes
- name: Create security group
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
tags:
testing: testing
delete: on-exit
@ -39,7 +45,7 @@
- name: Add/Update rules on existing security group
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
rules:
- name: AllowSSH
protocol: Tcp
@ -62,7 +68,7 @@
- name: Test idempotence
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
rules:
- name: AllowSSH
protocol: Tcp
@ -83,7 +89,7 @@
- name: Update tags
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
tags:
testing: testing
delete: never
@ -98,7 +104,7 @@
- name: Purge tags
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
tags:
testing: testing
delete: on-exit
@ -112,7 +118,7 @@
- name: Gather facts for one accounts
azure_rm_securitygroup_facts:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
register: output
- assert:
@ -131,7 +137,7 @@
- name: Create security group with source_address_prefixes
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
tags:
testing: testing
delete: on-exit
@ -159,7 +165,7 @@
- name: Create security group with source_address_prefixes(idempontent)
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: mysecgroup
name: "{{ secgroupname }}"
tags:
testing: testing
delete: on-exit

View file

@ -1,4 +1,3 @@
cloud/azure
posix/ci/cloud/group2/azure
destructive
unstable

View file

@ -1,12 +1,16 @@
- name: Prepare random number
set_fact:
vnetname: "vnet{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
- name: Delete virtual network, if it exists
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
resource_group: "{{ resource_group }}"
state: absent
- name: Create virtual network
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
address_prefixes_cidr:
- 10.1.0.0/16
- 172.100.0.0/16
@ -17,7 +21,7 @@
- name: Create virtual network
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
address_prefixes_cidr:
- 10.1.0.0/16
- 172.100.0.0/16
@ -40,7 +44,7 @@
- name: Gather facts by name, tags
azure_rm_virtualnetwork_facts:
resource_group: "{{ resource_group }}"
name: my_test_network
name: "{{ vnetname }}"
tags:
- testing
@ -66,7 +70,7 @@
- name: Should be idempotent
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
address_prefixes_cidr:
- 10.1.0.0/16
- 172.100.0.0/16
@ -84,7 +88,7 @@
- name: Update tags
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
tags:
testing: 'no'
delete: never
@ -97,7 +101,7 @@
- name: Purge tags
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
tags:
testing: 'always'
resource_group: "{{ resource_group }}"
@ -110,7 +114,7 @@
- name: Should require address_prefixes_cidr when purge_address_prefixes
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
purge_address_prefixes: true
resource_group: "{{ resource_group }}"
register: output
@ -121,7 +125,7 @@
- name: Purge address prefixes
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
address_prefixes_cidr: 10.1.0.0/16
purge_address_prefixes: true
resource_group: "{{ resource_group }}"
@ -136,7 +140,7 @@
- name: Purge DNS servers
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
purge_dns_servers: true
resource_group: "{{ resource_group }}"
register: output
@ -147,13 +151,13 @@
- name: Gather facts
azure_rm_virtualnetwork_facts:
resource_group: "{{ resource_group }}"
name: my_test_network
name: "{{ vnetname }}"
- assert:
that: "azure_virtualnetworks | length == 1"
- name: Delete virtual network
azure_rm_virtualnetwork:
name: my_test_network
name: "{{ vnetname }}"
resource_group: "{{ resource_group }}"
state: absent