-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
94 lines (85 loc) · 2.82 KB
/
main.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
82
83
84
85
86
87
88
89
90
91
92
93
94
---
- name: Create Check Point "HA pair" in Azure Stack
hosts: localhost
gather_facts: False
connection: local
tasks:
- name: Create generic resource group
run_once: True
azure_rm_resourcegroup:
name: "{{customer}}-generic-rg"
location: "{{location}}"
- name: Create per-host resource groups
azure_rm_resourcegroup:
name: "{{customer}}-{{inventory_hostname}}-rg"
location: "{{location}}"
- name: Create Vnets
run_once: True
azure_rm_virtualnetwork:
resource_group: "{{customer}}-generic-rg"
name: "{{customer}}-vnet"
address_prefixes_cidr: "{{vnet.prefix}}"
- name: Create UDR route tables
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_routetable:
resource_group: "{{customer}}-generic-rg"
name: "{{item.name}}-udr"
disable_bgp_route_propagation: True
- name: Create UDR routes (local)
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_route:
resource_group: "{{customer}}-generic-rg"
route_table_name: "{{item.name}}-udr"
name: "{{item.name}}-local"
address_prefix: "{{item.prefix}}"
next_hop_type: "vnet_local"
- name: Create UDR routes (monitor)
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_route:
resource_group: "{{customer}}-generic-rg"
route_table_name: "{{item.name}}-udr"
name: "{{item.name}}-monitor"
address_prefix: "{{monitor_subnet}}"
next_hop_type: "vnet_local"
- name: Create UDR routes (target)
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_route:
resource_group: "{{customer}}-generic-rg"
route_table_name: "{{item.name}}-udr"
name: "{{item.name}}-target"
address_prefix: "{{target_subnet}}"
next_hop_type: "virtual_appliance"
next_hop_ip_address: "{{cp_primary_backend}}"
- name: Create UDR routes (VNet)
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_route:
resource_group: "{{customer}}-generic-rg"
route_table_name: "{{item.name}}-udr"
name: "{{item.name}}-vnet"
address_prefix: "{{vnet.prefix}}"
next_hop_type: "virtual_appliance"
next_hop_ip_address: "{{cp_primary_backend}}"
- name: Create UDR routes (default)
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_route:
resource_group: "{{customer}}-generic-rg"
route_table_name: "{{item.name}}-udr"
name: "{{item.name}}-default"
address_prefix: "0.0.0.0/0"
next_hop_type: "virtual_appliance"
next_hop_ip_address: "{{cp_primary_backend}}"
- name: Create subnets
run_once: True
loop: "{{vnet.subnets}}"
azure_rm_subnet:
resource_group: "{{customer}}-generic-rg"
virtual_network_name: "{{customer}}-vnet"
name: "{{item.name}}"
address_prefix_cidr: "{{item.prefix}}"
route_table: "{{item.name}}-udr"