-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure-lb-and-dns.yaml
executable file
·95 lines (82 loc) · 3.05 KB
/
configure-lb-and-dns.yaml
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
95
#!/usr/bin/env ansible-playbook
---
- name: Start hcloud_instance
hosts: routers
connection: local
gather_facts: no
serial: 1
tasks:
- include_role:
name: hetzner-baremetal-openshift
tasks_from: create-dns-lb.yaml
# - name: Basis installation
# hosts: routers
# gather_facts: yes
# tasks:
# - name: install haproxy
# package:
# name:
# - haproxy
# # To get stats:
# # echo "show stat" | nc -U /var/lib/haproxy/stats | cut -d "," -f 1,2,18,57| column -s, -t;
# - nc
# state: present
# - name: Configure haproxy
# copy:
# backup: yes
# dest: /etc/haproxy/haproxy.cfg
# content: |
# global
# log 127.0.0.1 local2
# chroot /var/lib/haproxy
# pidfile /var/run/haproxy.pid
# maxconn 4000
# user haproxy
# group haproxy
# # turn on stats unix socket
# stats socket /var/lib/haproxy/stats
# #---------------------------------------------------------------------
# # common defaults that all the 'listen' and 'backend' sections will
# # use if not designated in their block
# #---------------------------------------------------------------------
# defaults
# mode http
# log global
# #option httplog
# option dontlognull
# #option http-server-close
# #option forwardfor except 127.0.0.0/8
# option redispatch
# retries 3
# timeout http-request 10s
# timeout queue 1m
# timeout connect 10s
# timeout client 1m
# timeout server 1m
# timeout http-keep-alive 10s
# timeout check 10s
# maxconn 3000
# listen machine-config-server
# bind 192.168.34.1:22623
# mode tcp
# {% for host in groups['masters'] -%}
# server {{ host }} {{ hostvars[host].internal_ip }}:22623 check
# {% endfor -%}
# {% for host in groups['bootstrap'] -%}
# server {{ host }} {{ hostvars[host].internal_ip }}:22623 check
# {% endfor -%}
# listen api
# bind 192.168.34.1:6443
# mode tcp
# {% for host in groups['masters'] -%}
# server {{ host }} {{ hostvars[host].internal_ip }}:6443 check
# {% endfor -%}
# {% for host in groups['bootstrap'] -%}
# server {{ host }} {{ hostvars[host].internal_ip }}:6443 check
# {% endfor -%}
# - name: enable haproxy
# systemd:
# name: haproxy
# enabled: yes
# masked: no
# state: started