forked from confluentinc/cp-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade_schema_registry.yml
49 lines (42 loc) · 1.61 KB
/
upgrade_schema_registry.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
---
- name: Schema Registry Upgrade
hosts: schema_registry
environment: "{{ proxy_env }}"
serial: 1
# there is a schema registry leader, should think about the master/follower thing
# look in schema reg docs
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
- name: Set Current Package Version
set_fact:
schema_registry_current_version: "{{ ansible_facts.packages['confluent-schema-registry'][0]['version'] }}"
- debug:
msg: "Current version: {{schema_registry_current_version}} Upgrade to version: {{confluent_package_version}}"
- name: Upgrade Schema Registry
include_tasks: tasks/upgrade_component.yml
vars:
service_name: "{{ schema_registry_service_name }}"
packages: "{{ schema_registry_packages }}"
backup_files:
- "{{ schema_registry.config_file }}"
- "{{ schema_registry.systemd_override }}"
restore_files:
- "{{ schema_registry.config_file }}"
when:
- schema_registry_current_version != confluent_full_package_version
- schema_registry_current_version != confluent_package_version
- name: Schema Registry Health Check
import_role:
name: confluent.schema_registry
tasks_from: health_check.yml
when: not ansible_check_mode