forked from confluentinc/cp-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzookeeper.yml
73 lines (64 loc) · 1.98 KB
/
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
70
71
72
73
---
- name: Zookeeper Status Finding
hosts: zookeeper
gather_facts: false
tags: zookeeper
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.variables
- name: Check if Zookeeper Service Running
shell: "systemctl show -p SubState {{zookeeper_service_name}}"
changed_when: false
# On some SELinux enabled hosts this command will error out, handled in next set_fact task
failed_when: false
check_mode: false
register: substate
- set_fact:
install_pattern: "{{ 'parallel' if substate.stdout != 'SubState=running' or substate.rc == 1 or zookeeper_deployment_strategy == 'parallel' else 'serial' }}"
- name: "Group Hosts by Installation Pattern: Parallel or Serial"
group_by:
key: zookeeper_{{install_pattern}}
changed_when: false
- name: Zookeeper Parallel Provisioning
hosts: zookeeper_parallel
gather_facts: false
tags: zookeeper
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.zookeeper
- name: Zookeeper Serial Ordering
hosts: zookeeper_serial
gather_facts: false
tags: zookeeper
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.zookeeper
tasks_from: dynamic_groups.yml
- name: Zookeeper Followers Provisioning
hosts: zookeeper_follower
serial: 1
gather_facts: false
tags: zookeeper
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.zookeeper
- name: Proceed Prompt
pause:
prompt: "Press Enter to Proceed to Next Node. Ctrl + C to Abort"
when: zookeeper_pause_rolling_deployment|bool
- name: Zookeeper Leader Provisioning
hosts: zookeeper_leader
gather_facts: false
tags: zookeeper
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.zookeeper
- name: Proceed Prompt
pause:
prompt: "Press Enter to Proceed to Next Node. Ctrl + C to Abort"
when: zookeeper_pause_rolling_deployment|bool