2018-02-13 00:34:01 +08:00
|
|
|
---
|
2022-03-12 10:08:23 +08:00
|
|
|
- name: Get currently-deployed etcd version
|
|
|
|
command: "{{ bin_dir }}/etcd --version"
|
|
|
|
register: etcd_current_host_version
|
|
|
|
# There's a chance this play could run before etcd is installed at all
|
|
|
|
ignore_errors: true
|
|
|
|
when: etcd_cluster_setup
|
|
|
|
|
|
|
|
- name: Restart etcd if necessary
|
|
|
|
command: /bin/true
|
2023-07-26 22:36:22 +08:00
|
|
|
notify: Restart etcd
|
2022-03-12 10:08:23 +08:00
|
|
|
when:
|
|
|
|
- etcd_cluster_setup
|
2023-07-05 11:36:54 +08:00
|
|
|
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout | default('')
|
2022-03-12 10:08:23 +08:00
|
|
|
|
|
|
|
- name: Restart etcd-events if necessary
|
|
|
|
command: /bin/true
|
2023-07-26 22:36:22 +08:00
|
|
|
notify: Restart etcd-events
|
2022-03-12 10:08:23 +08:00
|
|
|
when:
|
|
|
|
- etcd_events_cluster_setup
|
2023-07-05 11:36:54 +08:00
|
|
|
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout | default('')
|
2022-03-12 10:08:23 +08:00
|
|
|
|
2023-08-23 22:04:22 +08:00
|
|
|
- name: Install | Copy etcd binary from download dir
|
2018-09-27 17:12:02 +08:00
|
|
|
copy:
|
2019-04-25 19:58:47 +08:00
|
|
|
src: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
|
2018-09-16 10:50:56 +08:00
|
|
|
dest: "{{ bin_dir }}/{{ item }}"
|
2018-09-27 17:12:02 +08:00
|
|
|
mode: 0755
|
|
|
|
remote_src: yes
|
2018-09-16 10:50:56 +08:00
|
|
|
with_items:
|
2021-01-23 12:41:39 +08:00
|
|
|
- etcd
|
2018-07-30 17:55:25 +08:00
|
|
|
when: etcd_cluster_setup
|