-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path39799.yml
80 lines (75 loc) · 2.12 KB
/
39799.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
80
---
- name: Create Azure VM
hosts: localhost
connection: local
gather_facts: false
roles:
- role: azure_preview_modules
tasks:
- name: Create Resource Group
azure_rm_resourcegroup:
name: myRG01
location: eastus
- name: Create virtual network
local_action:
module: azure_rm_virtualnetwork
resource_group: myRG01
name: myVnet
address_prefixes: "10.0.0.0/16"
- name: Create Network Security Group
local_action:
module: azure_rm_securitygroup
resource_group: myRG01
name: myNetworkSecurityGroup
purge_default_rules: yes
rules:
- name: SSH
protocol: Tcp
destination_port_range: 22
access: Allow
priority: 1001
direction: Inbound
- name: HTTP
protocol: Tcp
destination_port_range: 80
access: Allow
priority: 1002
direction: Inbound
- name: port_8080
protocol: Tcp
destination_port_range: 8080
access: Allow
priority: 1003
direction: Inbound
- name: port_443
protocol: Tcp
destination_port_range: 443
access: Allow
priority: 1004
direction: Inbound
- name: Add subnet
local_action:
module: azure_rm_subnet
resource_group: myRG01
name: mySubnet
address_prefix: "10.0.1.0/24"
virtual_network: myVnet
- name: Create virtual network inteface card
local_action:
module: azure_rm_networkinterface
resource_group: myRG01
name: myNIC
virtual_network: myVnet
subnet: mySubnet
public_ip_name: myPublicIP
security_group_name: myNetworkSecurityGroup
register: NIC_log
- name: dump NIC log
debug:
var: NIC_log
- name: Create public IP address
local_action:
module: azure_rm_publicipaddress
resource_group: myRG01
allocation_method: Static
name: myPublicIP