-
Notifications
You must be signed in to change notification settings - Fork 8
/
install_struct.yml
179 lines (165 loc) · 4.5 KB
/
install_struct.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
---
# init all hosts
- name: set host machine hosts file
vars_files:
- vars.yml
- vars-deploy.yml
hosts: localhost
tasks:
- lineinfile:
dest: /etc/hosts
regexp: "^.*? {{ item }}$"
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ item }}"
state: present
create: yes
with_inventory_hostnames: all
tags: always
- name: init os
vars_files:
- vars.yml
- vars-deploy.yml
hosts: tis-console,assemble,solr,hadoop-hdfs-namenode,hadoop-hdfs-datanode,hadoop-yarn-resource-manager,hadoop-yarn-node-manager,zookeeper
tasks:
- include_role:
name: init-os
- include_role:
name: jdk
tags:
- initos
- name: install zookeeper
vars_files:
- vars.yml
- vars-deploy.yml
hosts: zookeeper
tasks:
- shell: 'ls {{ tis_release_dir }}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: zookeeper
when: need_install_zookeeper and release_files.stdout.find('zookeeper-3.4.14.tar.gz') != -1
tags:
- zk
- name: install hadoop
vars_files:
- vars.yml
- vars-deploy.yml
hosts: hadoop-hdfs-namenode,hadoop-hdfs-datanode,hadoop-yarn-resource-manager,hadoop-yarn-node-manager
tasks:
- name: 'ls {{ tis_release_dir }}'
shell: 'ls {{ tis_release_dir }}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: hadoop
when: need_install_hadoop and release_files.stdout.find( hadoop_gz_file_name ) != -1
tags:
- hadoop
- name: install hive
vars_files:
- vars.yml
- vars-deploy.yml
hosts: hadoop-hdfs-namenode
tasks:
- include_role:
name: hive
when: need_install_hadoop
tags:
- hive
- name: install spark
vars_files:
- vars.yml
- vars-deploy.yml
hosts: hadoop-yarn-resource-manager,hadoop-yarn-node-manager
tasks:
- shell: 'ls {{ tis_release_dir }}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: spark
when: need_install_hadoop and need_install_spark and release_files.stdout.find(spark_gz_file_name) != -1
tags:
- spark
- name: install tis_console
vars_files:
- vars.yml
- vars-deploy.yml
vars:
tis_app_name: tjs
hosts: tis-console
tasks:
- shell: 'ls {{tis_release_dir}}/{{tis_release_dir_name}}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: console
when: release_files.stdout.find('tis.tar.gz') != -1
- name: mkdir ng-tis dir {{app_dir}}/root/webapp
file:
path: "{{app_dir}}/root/webapp"
state: directory
# - name: 'deploy ng-tis to {{app_dir}}/root/'
# unarchive:
# src: "{{tis_release_dir}}/{{tis_release_dir_name}}/{{ng_tis_app_tar_file_name}}"
# dest: "{{app_dir}}/root/webapp"
# remote_src: no
- include: install_ng_tis.yml
when: release_files.stdout.find(ng_tis_app_tar_file_name) != -1
tags:
- tjs
- name: install assemble
vars:
tis_app_name: tis-assemble
vars_files:
- vars.yml
- vars-deploy.yml
hosts: assemble
tasks:
- shell: 'ls {{tis_release_dir}}/{{tis_release_dir_name}}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: assemble
when: release_files.stdout.find('tis-assemble.tar.gz') != -1
# collect先安装在assemble同一个节点上
# 先不装 collect了
# - include_role:
# name: cluster-state-collector
# when: need_install_tis_collect and release_files.stdout.find('tis-collect.tar.gz') != -1
tags:
- assemble
- name: install indexbuilder
vars_files:
- vars.yml
- vars-deploy.yml
hosts: hadoop-yarn-resource-manager,hadoop-yarn-node-manager
tasks:
- shell: 'ls {{tis_release_dir}}/{{tis_release_dir_name}}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: index-builder
when: release_files.stdout.find('tis-index-builder.tar.gz') != -1
tags:
- indexbuilder
- name: install solr-core
hosts: solr
vars_files:
- vars.yml
- vars-deploy.yml
tasks:
- shell: 'ls {{tis_release_dir}}/{{tis_release_dir_name}}'
ignore_errors: True
register: release_files
delegate_to: "localhost"
- include_role:
name: solr-core
when: release_files.stdout.find('solr.tar.gz') != -1
tags:
- solr