forked from confluentinc/cp-ansible
-
Notifications
You must be signed in to change notification settings - Fork 2
/
upgrade_control_center.yml
58 lines (50 loc) · 1.78 KB
/
upgrade_control_center.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
- name: Control Center Upgrade
hosts: control_center
serial: 1
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:
control_center_current_version: "{{ ansible_facts.packages['confluent-control-center'][0]['version'] }}"
- debug:
msg: "Current version: {{control_center_current_version}} Upgrade to version: {{confluent_package_version}}"
- name: Upgrade Control Center
include_tasks: tasks/upgrade_component.yml
vars:
service_name: "{{ control_center_service_name }}"
packages: "{{ control_center_packages }}"
backup_files:
- "{{ control_center.config_file }}"
- "{{ control_center.systemd_override }}"
restore_files:
- "{{ control_center.config_file }}"
when:
- control_center_current_version != confluent_full_package_version
- control_center_current_version != confluent_package_version
- name: Wait for webpage to serve HTTP content
uri:
url: "http://localhost:{{control_center_port}}"
register: result
until: result.status == 200
retries: 60
delay: 5
when: not ssl_enabled|bool
- name: Wait for webpage to serve HTTPS content
uri:
url: "https://localhost:{{control_center_port}}"
validate_certs: no
register: result
until: result.status == 200
retries: 60
delay: 5
when: ssl_enabled|bool