-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yaml
114 lines (99 loc) · 2.38 KB
/
deploy.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
- hosts: bootstrap,masters,workers
remote_user: root
tasks:
- name: 检查主机名
shell: "echo $(hostname)"
- name: 检查主机IP
shell: "echo $(ip a)"
- name: 本地yum源配置
copy:
src: "/etc/yum.repos.d"
dest: "/etc/"
- name: 复制启动脚本
copy:
src: "./scripts/installer.sh"
dest: "/root/installer.sh"
- hosts: haproxy
remote_user: root
tasks:
- name: 安装Haproxy
yum:
name: haproxy
state: present
- name: 配置Haproxy
template:
src: ../templates/haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
notify:
- restart haproxy
- name: 允许haproxy绑定任意网卡
seboolean:
name: haproxy_connect_any
state: yes
persistent: yes
notify:
- restart haproxy
- name: 启动haproxy
service:
name: haproxy
state: started
enabled: yes
handlers:
- name: restart haproxy
service:
name: haproxy
state: restarted
- hosts: dns
remote_user: root
tasks:
- name: install dns
yum:
name:
- bind
- bind-utils
state: present
- name: Write out "{{ dns.domain | lower }}" zone file
template:
src: ../templates/zonefile.j2
dest: /var/named/zonefile.db
mode: '0644'
notify:
- restart bind
- name: Write out reverse zone file
template:
src: ../templates/reverse.j2
dest: /var/named/reverse.db
mode: '0644'
notify:
- restart bind
- name: enabled bind
service:
name: named
state: started
enabled: yes
handlers:
- name: restart bind
service:
name: named
state: restarted
- hosts: bootstrap
remote_user: root
tasks:
- name: 修改Bootstrap节点内核启动项
shell: "sh /root/installer.sh bootstrap"
- hosts: masters
remote_user: root
tasks:
- name: 修改Master节点内核启动项
shell: "sh /root/installer.sh master"
- hosts: workers
remote_user: root
tasks:
- name: 修改Worker节点内核启动项
shell: "sh /root/installer.sh worker"
- hosts: all
remote_user: root
tasks:
- name: 检查系统系统项
shell: "cat /etc/grub.d/40_custom"