-
Notifications
You must be signed in to change notification settings - Fork 5
/
init-cluster.yml
85 lines (81 loc) · 1.9 KB
/
init-cluster.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
---
- hosts: localhost
gather_facts: no
tasks:
# -------------- Prepare Firewalls -------------- #
- name: "{{ env }} - Init MASTERS firewall"
vultr_firewall_group:
name: "{{ env }}_MASTERS"
- name: "{{ env }} - Create FW rules"
vultr_firewall_rule:
group: "{{ env }}_MASTERS"
protocol: "{{ item.proto }}"
port: "{{ item.port }}"
cidr: "{{ item.cidr }}"
with_items:
# Allow http
- port: 80
cidr: "0.0.0.0/0"
proto: tcp
# Allow https
- port: 443
cidr: "0.0.0.0/0"
proto: tcp
# SSH port
- port: 22
cidr: "0.0.0.0/0"
proto: tcp
# SSH port
- port: 65022
cidr: "0.0.0.0/0"
proto: tcp
# Nomad mgmt
- port: 4646
cidr: "0.0.0.0/0"
proto: tcp
- name: "{{ env }} - Init NODES firewall"
vultr_firewall_group:
name: "{{ env }}_NODES"
- name: "{{ env }} - Cretate NODES rules"
vultr_firewall_rule:
group: "{{ env }}_NODES"
protocol: "{{ item.proto }}"
port: "{{ item.port }}"
cidr: "{{ item.cidr }}"
with_items:
# Allow http
- port: 80
cidr: "0.0.0.0/0"
proto: tcp
# Allow https
- port: 433
cidr: "0.0.0.0/0"
proto: tcp
# SSH port
- port: 22
cidr: "0.0.0.0/0"
proto: tcp
# SSH port
- port: 65022
cidr: "0.0.0.0/0"
proto: tcp
- hosts: cluster
gather_facts: no
pre_tasks:
- name: "{{ env }} - Cloud members are running"
local_action:
module: vultr_server
name: "{{ inventory_hostname_short }}"
os: "{{ os }}"
private_network_enabled: yes
plan: "{{ plan }}"
ssh_keys:
- marek
- github
# - "{{ root_keys }}"
firewall_group: "{{ firewall_grp }}"
region: "{{ region }}"
state: present
- name: "Configure base servers"
ansible.builtin.import_playbook: deploy.yml
- import_playbook: cloudflare_dns.yml