-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbkp.yml
51 lines (47 loc) · 1.69 KB
/
bkp.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
---
- name: Azure 3 tier architecutre
hosts: localhost
connection: local
vars:
azure_resource_group_name: "demo-rg"
azure_resource_group_location: "uksouth"
azure_virtual_network_name: "demo-vnet"
azure_virtual_network_address: "10.0.0.0/16"
azure_subnet_name: "demo-snet"
azure_subnet_address: "10.0.1.0/24"
azure_publicip_name: "demo-pub-ip"
azure_security_group_name: "demo-sg"
azure_network_interface_card_name: "demo-nic"
tasks:
- name: create subnet
azure_rm_subnet:
resource_group: "{{azure_resource_group_name}}"
name: "{{azure_subnet_name}}"
address_prefix: "{{azure_subnet_address}}"
virtual_network: "{{azure_virtual_network_name}}"
- name: create public IP address
azure_rm_publicipaddress:
resource_group: "{{azure_resource_group_name}}"
allocation_method: Static
name: "{{azure_publicip_name}}"
register: output_ip_address
- name: create Network Security Group that allows SSH
azure_rm_securitygroup:
resource_group: "{{azure_resource_group_name}}"
name: "{{azure_security_group_name}}"
rules:
- name: HTTPS
protocol: TCP
destination_port_range: 443
sourceAddressPrefix: "20.30.40.48/30"
access: Allow
priority: 1001
direction: Inbound
- name: create virtual network interface card
azure_rm_networkinterface:
resource_group: "{{azure_resource_group_name}}"
name: "{{azure_network_interface_card_name}}"
virtual_network: "{{azure_virtual_network_name}}"
subnet: "{{azure_subnet_name}}"
public_ip_name: "{{azure_publicip_name}}"
security_group: "{{azure_security_group_name}}"