forked from confluentinc/cp-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade_kafka_broker_log_format.yml
39 lines (33 loc) · 1.12 KB
/
upgrade_kafka_broker_log_format.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
- name: Kafka Broker Upgrade - Set Log Message Format Version to Current Version
hosts: kafka_broker
gather_facts: no
serial: 1
vars:
kafka_broker_upgrade_end_version: "5.4"
tasks:
- import_role:
name: confluent.variables_handlers
- name: Get Package Facts
package_facts:
manager: auto
- set_fact:
confluent_server_enabled: true
when: ansible_facts.packages['confluent-server'] is defined
- set_fact:
confluent_server_enabled: false
when: ansible_facts.packages['confluent-kafka-2.12'] is defined
- set_fact:
log_message_format_version: 2.3
when: kafka_broker_upgrade_end_version is match('5.3.*')
- set_fact:
log_message_format_version: 2.4
when: kafka_broker_upgrade_end_version is match('5.4.*')
- name: Set Log Message Format Version to Current Version
lineinfile:
name: "{{kafka_broker.config_file}}"
line: "log.message.format.version={{log_message_format_version}}"
regexp: log.message.format.version.*
state: present
notify:
- Restart Kafka
- Wait for URP