-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into securitygroup-stringy-ports
- Loading branch information
Showing
6 changed files
with
97 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 43 additions & 22 deletions
65
tests/integration/targets/inventory_azure/playbooks/setup.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
--- | ||
- include_vars: | ||
file: vars.yml | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
|
||
- name: SETUP | Create storage account | ||
azure_rm_storageaccount: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ storage_account }}" | ||
account_type: Standard_LRS | ||
tasks: | ||
- include_vars: vars.yml | ||
- name: SETUP | Create storage account | ||
azure_rm_storageaccount: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ storage_account }}" | ||
account_type: Standard_LRS | ||
|
||
- name: SETUP | Create availability set | ||
azure_rm_availabilityset: | ||
name: "{{ availability_set }}" | ||
resource_group: "{{ resource_group }}" | ||
- name: SETUP | Create availability set | ||
azure_rm_availabilityset: | ||
name: "{{ availability_set }}" | ||
resource_group: "{{ resource_group }}" | ||
|
||
- name: SETUP | Create virtual network | ||
azure_rm_virtualnetwork: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ network_name }}" | ||
address_prefixes: "{{ network }}" | ||
- name: SETUP | Create virtual network | ||
azure_rm_virtualnetwork: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ network_name }}" | ||
address_prefixes: "{{ network }}" | ||
|
||
- name: SETUP | Create subnet | ||
azure_rm_subnet: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ subnet_name }}" | ||
address_prefix: "{{ subnet }}" | ||
virtual_network: "{{ network_name }}" | ||
- name: SETUP | Create subnet | ||
azure_rm_subnet: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ subnet_name }}" | ||
address_prefix: "{{ subnet }}" | ||
virtual_network: "{{ network_name }}" | ||
|
||
- name: Create minimal VM with defaults | ||
azure_rm_virtualmachine: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
admin_username: testuser | ||
ssh_password_enabled: false | ||
ssh_public_keys: | ||
- path: /home/testuser/.ssh/authorized_keys | ||
key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" | ||
vm_size: Standard_B1ms | ||
virtual_network: "{{ network_name }}" | ||
image: | ||
offer: UbuntuServer | ||
publisher: Canonical | ||
sku: 16.04-LTS | ||
version: latest | ||
register: vm_output |
58 changes: 36 additions & 22 deletions
58
tests/integration/targets/inventory_azure/playbooks/teardown.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
--- | ||
- name: Destroy subnet | ||
azure_rm_subnet: | ||
resource_group: "{{ resource_group }}" | ||
virtual_network: "{{ network_name }}" | ||
name: "{{ subnet_name }}" | ||
state: absent | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
|
||
- name: Destroy virtual network | ||
azure_rm_virtualnetwork: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ network_name }}" | ||
state: absent | ||
tasks: | ||
- include_vars: vars.yml | ||
|
||
- name: Destroy availability set | ||
azure_rm_availabilityset: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ availability_set }}" | ||
state: absent | ||
- name: Delete VM | ||
azure_rm_virtualmachine: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
remove_on_absent: all_autocreated | ||
state: absent | ||
|
||
- name: Destroy storage account | ||
azure_rm_storageaccount: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ storage_account }}" | ||
force_delete_nonempty: yes | ||
state: absent | ||
- name: Destroy subnet | ||
azure_rm_subnet: | ||
resource_group: "{{ resource_group }}" | ||
virtual_network: "{{ network_name }}" | ||
name: "{{ subnet_name }}" | ||
state: absent | ||
|
||
- name: Destroy virtual network | ||
azure_rm_virtualnetwork: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ network_name }}" | ||
state: absent | ||
|
||
- name: Destroy availability set | ||
azure_rm_availabilityset: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ availability_set }}" | ||
state: absent | ||
|
||
- name: Destroy storage account | ||
azure_rm_storageaccount: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ storage_account }}" | ||
force_delete_nonempty: yes | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/integration/targets/inventory_azure/templates/basic2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
plugin: azure_rm | ||
plain_host_names: yes |