forked from hortonworks/ansible-hortonworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_azure.yml
50 lines (45 loc) · 1.78 KB
/
build_azure.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: Build the Cloud Environment
hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Build {{ cloud_config.resource_group }} Resource Group
azure_rm_resourcegroup:
name: "{{ cloud_config.resource_group }}"
location: "{{ cloud_config.location }}"
state: present
force: yes
ignore_errors: yes
- name: Create {{ cloud_config.storage_account.name }} Storage Account
azure_rm_storageaccount:
resource_group: "{{ cloud_config.resource_group }}"
name: "{{ cloud_config.storage_account.name }}"
account_type: "{{ cloud_config.storage_account.type }}"
- name: Create {{ cloud_config.network.name }} Virtual Network
azure_rm_virtualnetwork:
resource_group: "{{ cloud_config.resource_group }}"
name: "{{ cloud_config.network.name }}"
address_prefixes_cidr: "{{ cloud_config.network.address }}"
- name: Create {{ cloud_config.subnet.name }} Subnet
azure_rm_subnet:
resource_group: "{{ cloud_config.resource_group }}"
virtual_network_name: "{{ cloud_config.network.name }}"
name: "{{ cloud_config.subnet.name }}"
address_prefix_cidr : "{{ cloud_config.subnet.address }}"
- name: Create security groups
azure_rm_securitygroup:
resource_group: "{{ cloud_config.resource_group }}"
name: "{{ item.name }}"
rules:
- name: "AllowPort_{{ item.port }}"
protocol: Tcp
destination_port_range: "{{ item.port }}"
access: Allow
direction: Inbound
priority: 101
with_items: "{{ cloud_config.security_groups }}"
- name: Build Azure Nodes
include_tasks: build_azure_nodes.yml
when: item.count > 0
with_items: "{{ nodes }}"