-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure_network_2subnet.yml
81 lines (41 loc) · 1.45 KB
/
azure_network_2subnet.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
81
- name: Create Network Cards
hosts: virtualmachines
connection: local
gather_facts: no
vars:
rgName: "{{env_id}}-rg-{{resource_group}}"
vnet_name: "{{env_id}}-vnet"
tasks:
- name: Create public IP address
azure_rm_publicipaddress:
resource_group: "{{rgName}}"
allocation_method: Dynamic
name: "{{inventory_hostname}}-pip"
- name: Create virtual network inteface card - FE
azure_rm_networkinterface:
resource_group: "{{rgName}}"
name: "{{inventory_hostname}}-nic-fe"
virtual_network:
name: "{{env_id}}-vnet"
resource_group: "{{env_id}}-rg-{{vnet_rg}}"
subnet: "{{env_id}}-subnet-fe"
security_group: "{{env_id}}-nsg-fe"
ip_configurations:
- name: ipconfig1
private_ip_allocation_method: Static
private_ip_address: "{{ansible_ssh_host}}"
public_ip_address_name: "{{inventory_hostname}}-pip"
primary: true
- name: Create virtual network inteface card - BE
azure_rm_networkinterface:
resource_group: "{{rgName}}"
name: "{{inventory_hostname}}-nic-be"
virtual_network:
name: "{{env_id}}-vnet"
resource_group: "{{env_id}}-rg-{{vnet_rg}}"
subnet: "{{env_id}}-subnet-be"
security_group: "{{env_id}}-nsg-be"
ip_configurations:
- name: ipconfig1
private_ip_allocation_method: Static
private_ip_address: "{{secondary_ip}}"