2018-02-12 16:34:01 +00:00
|
|
|
---
|
2022-03-12 02:08:23 +00: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
|
|
|
|
notify: restart etcd
|
|
|
|
when:
|
|
|
|
- etcd_cluster_setup
|
|
|
|
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout|default('')
|
|
|
|
|
|
|
|
- name: Restart etcd-events if necessary
|
|
|
|
command: /bin/true
|
|
|
|
notify: restart etcd-events
|
|
|
|
when:
|
|
|
|
- etcd_events_cluster_setup
|
|
|
|
- etcd_version.lstrip('v') not in etcd_current_host_version.stdout|default('')
|
|
|
|
|
2021-01-23 04:41:39 +00:00
|
|
|
- name: install | Download etcd and etcdctl
|
|
|
|
include_tasks: "../../download/tasks/download_file.yml"
|
|
|
|
vars:
|
|
|
|
download: "{{ download_defaults | combine(downloads.etcd) }}"
|
|
|
|
when: etcd_cluster_setup
|
|
|
|
tags:
|
|
|
|
- never
|
|
|
|
- etcd
|
|
|
|
|
2018-09-16 02:50:56 +00:00
|
|
|
- name: install | Copy etcd and etcdctl binary from download dir
|
2018-09-27 09:12:02 +00:00
|
|
|
copy:
|
2019-04-25 11:58:47 +00:00
|
|
|
src: "{{ local_release_dir }}/etcd-{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
|
2018-09-16 02:50:56 +00:00
|
|
|
dest: "{{ bin_dir }}/{{ item }}"
|
2018-09-27 09:12:02 +00:00
|
|
|
mode: 0755
|
|
|
|
remote_src: yes
|
2018-09-16 02:50:56 +00:00
|
|
|
with_items:
|
2021-01-23 04:41:39 +00:00
|
|
|
- etcd
|
|
|
|
- etcdctl
|
2018-07-30 09:55:25 +00:00
|
|
|
when: etcd_cluster_setup
|