forked from confluentinc/cp-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkafka_broker.yml
73 lines (64 loc) · 2.07 KB
/
kafka_broker.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: Kafka Broker Status Finding
hosts: kafka_broker
gather_facts: false
tags: kafka_broker
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.variables
- name: Check if Kafka Service Running
shell: "systemctl show -p SubState {{kafka_broker_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 kafka_broker_deployment_strategy == 'parallel' else 'serial' }}"
- name: "Group Hosts by Installation Pattern: Parallel or Serial"
group_by:
key: kafka_broker_{{install_pattern}}
changed_when: false
- name: Kafka Broker Parallel Provisioning
hosts: kafka_broker_parallel
gather_facts: false
tags: kafka_broker
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.kafka_broker
- name: Kafka Broker Serial Ordering
hosts: kafka_broker_serial
gather_facts: false
tags: kafka_broker
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.kafka_broker
tasks_from: dynamic_groups.yml
- name: Kafka Broker Non Controllers Provisioning
hosts: kafka_broker_non_controller
serial: 1
gather_facts: false
tags: kafka_broker
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.kafka_broker
- name: Proceed Prompt
pause:
prompt: "Press Enter to Proceed to Next Node. Ctrl + C to Abort"
when: kafka_broker_pause_rolling_deployment|bool
- name: Kafka Broker Controller Provisioning
hosts: kafka_broker_controller
gather_facts: false
tags: kafka_broker
environment: "{{ proxy_env }}"
tasks:
- import_role:
name: confluent.kafka_broker
- name: Proceed Prompt
pause:
prompt: "Press Enter to Proceed to Next Node. Ctrl + C to Abort"
when: kafka_broker_pause_rolling_deployment|bool