-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazuretestcreate.yml
70 lines (63 loc) · 1.76 KB
/
azuretestcreate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
- name: CREATE VM PLAYBOOK
hosts: localhost
connection: local
gather_facts: False
vars:
# vmname: josetestansible03
tasks:
- name: Create storage account
azure_rm_storageaccount:
resource_group: ResGroupRH01
name: sjwtestaccount201
account_type: Standard_LRS
- name: Create virtual network
azure_rm_virtualnetwork:
resource_group: ResGroupRH01
name: testvn001
address_prefixes: "10.10.0.0/16"
- name: Add subnet
azure_rm_subnet:
resource_group: ResGroupRH01
name: subnet001
address_prefix: "10.10.0.0/24"
virtual_network: testvn001
- name: Create public ip
azure_rm_publicipaddress:
resource_group: ResGroupRH01
allocation_method: Static
name: publicip001
- name: Create security group that allows SSH
azure_rm_securitygroup:
resource_group: ResGroupRH01
name: secgroup001
rules:
- name: SSH
protocol: Tcp
destination_port_range: 22
access: Allow
priority: 101
direction: Inbound
- name: Create NIC
azure_rm_networkinterface:
resource_group: ResGroupRH01
name: testnic001
virtual_network: testvn001
subnet: subnet001
public_ip_name: publicip001
security_group: secgroup001
- name: Create virtual machine
azure_rm_virtualmachine:
resource_group: ResGroupRH01
name: testvm101
vm_size: Standard_D1
storage_account: sjwtestaccount201
storage_container: testvm101
storage_blob: testvm101.vhd
admin_username: "{{ usernn }}"
admin_password: "{{ passwdd }}"
network_interfaces: testnic001
image:
offer: CentOS
publisher: OpenLogic
sku: '7.1'
version: latest