-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03-install-zookeeper.yml
70 lines (60 loc) · 1.67 KB
/
03-install-zookeeper.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
---
- hosts: all
become: true
remote_user: root
tasks:
- name: Extract zookeeper into /opt/
unarchive:
remote_src: yes
validate_certs: false
src: http://us.mirrors.quenda.co/apache/zookeeper/zookeeper-3.5.8/apache-zookeeper-3.5.8-bin.tar.gz
dest: /opt/
- name: Create a symbolic link
file:
src: /opt/apache-zookeeper-3.5.8-bin
dest: /opt/zookeeper
owner: zookeeper
group: zookeeper
state: link
- name: Create zookeeper data directory
file:
path: /var/zookeeper/data
state: directory
- name: Configure ZooKeeper zoo.cfg
template:
src: zoo.cfg.j2
dest: /opt/zookeeper/conf/zoo.cfg
owner: zookeeper
group: zookeeper
- name: Configure ZooKeeper ID
template:
src: myid.j2
dest: /var/zookeeper/data/myid
owner: zookeeper
group: zookeeper
- name: Recursively change ownership of a directory
file:
path: /opt/apache-zookeeper-3.5.8-bin
state: directory
recurse: yes
owner: zookeeper
group: zookeeper
- name: Recursively change ownership of a directory
file:
path: /var/zookeeper/data
state: directory
recurse: yes
owner: zookeeper
group: zookeeper
- name: Create a zookeeper service
copy:
src: templates/zookeeper.service
dest: /etc/systemd/system/zookeeper.service
owner: root
group: root
- name: Restart zookeeper and enable as service
service:
name: zookeeper
daemon_reload: yes
state: restarted
enabled: yes