-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path41728.yml
41 lines (41 loc) · 1.4 KB
/
41728.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
- name: Create Network Cards
hosts: vms
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}}"