-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path38977.yml
79 lines (72 loc) · 2.44 KB
/
38977.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
71
72
73
74
75
76
77
78
79
- name: Create Azure VM
# hosts: control01
hosts: localhost
vars:
resource_group: myRG04
location: eastus
virtualnetwork: virtualnetwork04
subnet: subnet04
public_ip: public_ip04
security_ssh: security_ssh04
test_nic: test_nic04
tasks:
- name: create resource group
azure_rm_resourcegroup:
name: "{{ resource_group }}"
location: "{{ location }}"
- name: create virtual network
azure_rm_virtualnetwork:
resource_group: "{{ resource_group }}"
name: "{{ virtualnetwork }}"
address_prefixes: "10.0.0.0/16"
- name: Add subnet
azure_rm_subnet:
resource_group: "{{ resource_group }}"
name: "{{ subnet }}"
address_prefix: "10.0.1.0/24"
virtual_network: "{{ virtualnetwork }}"
- name: create public ip
azure_rm_publicipaddress:
resource_group: "{{ resource_group }}"
allocation_method: Static
name: "{{ public_ip }}"
- name: Create security group that allows SSH
azure_rm_securitygroup:
resource_group: "{{ resource_group }}"
name: "{{ security_ssh }}"
rules:
- name: SSH
protocol: Tcp
destination_port_range: 22
access: Allow
priority: 101
direction: Inbound
- name: Create NIC
azure_rm_networkinterface:
resource_group: "{{ resource_group }}"
name: "{{ test_nic }}"
virtual_network: "{{ virtualnetwork }}"
subnet: "{{ subnet }}"
public_ip_name: "{{ public_ip}}"
security_group: "{{ security_ssh }}"
- name: Create VM
azure_rm_virtualmachine:
resource_group: "{{ resource_group }}"
name: '{{ item }}'
vm_size: Standard_DS1_v2
admin_username: centos
ssh_password_enabled: false
ssh_public_keys:
- path: /home/centos/.ssh/authorized_keys
key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6RUJHaZHn5mzhHGdsymPW7p5tymtGy761uw1RAAH9aM498PNPQMwyw+kgG8ZaGiEGyzNAlzNYCzTdQ41j8nG1g7p+wEc0BWBWueGONM8fSaROqadSYZjafBEYywxEDED4q2UlRN90sGnW6TC2ldae3XgaUlQ6V1hlwm/Hr2FA8A5tek20KsZT3f0XycIcvXu40f5HRT7I2QuBtpD8E46jn3WRRAC4cmU35TMYEmAeY9X9IZplLIPiRJENO7gi6BnYNn5siiOd6MrZ18sEkz6lzfDtiqqkN/Axoa4f1nipgB9DcZRN5iaNvepynwAMklyk5gsCDqvc03sm6n8PZlzB fred@fred-Virtual-Machine
"
image:
offer: CentOS
# publisher: Rogue Wave Software (formerly OpenLogic)
publisher: OpenLogic
sku: '7.4'
version: latest
with_items:
- zk01
- zk02
- zk03