2016-01-19 22:23:19 +08:00
|
|
|
---
|
2020-03-24 23:12:47 +08:00
|
|
|
- import_tasks: install_etcdctl_docker.yml
|
2018-04-02 00:58:08 +08:00
|
|
|
when: etcd_cluster_setup
|
2018-02-13 00:34:01 +08:00
|
|
|
|
2022-03-12 10:08:23 +08:00
|
|
|
- name: Get currently-deployed etcd version
|
|
|
|
shell: "{{ docker_bin_dir }}/docker ps --filter='name={{ etcd_member_name }}' --format='{{ '{{ .Image }}' }}'"
|
|
|
|
register: etcd_current_docker_image
|
|
|
|
when: etcd_cluster_setup
|
|
|
|
|
|
|
|
- name: Get currently-deployed etcd-events version
|
|
|
|
shell: "{{ docker_bin_dir }}/docker ps --filter='name={{ etcd_member_name }}-events' --format='{{ '{{ .Image }}' }}'"
|
|
|
|
register: etcd_events_current_docker_image
|
|
|
|
when: etcd_events_cluster_setup
|
|
|
|
|
|
|
|
- name: Restart etcd if necessary
|
|
|
|
command: /bin/true
|
|
|
|
notify: restart etcd
|
|
|
|
when:
|
|
|
|
- etcd_cluster_setup
|
|
|
|
- etcd_image_tag not in etcd_current_docker_image.stdout|default('')
|
|
|
|
|
|
|
|
- name: Restart etcd-events if necessary
|
|
|
|
command: /bin/true
|
|
|
|
notify: restart etcd-events
|
|
|
|
when:
|
|
|
|
- etcd_events_cluster_setup
|
|
|
|
- etcd_image_tag not in etcd_events_current_docker_image.stdout|default('')
|
|
|
|
|
2018-02-13 00:34:01 +08:00
|
|
|
- name: Install etcd launch script
|
|
|
|
template:
|
|
|
|
src: etcd.j2
|
|
|
|
dest: "{{ bin_dir }}/etcd"
|
|
|
|
owner: 'root'
|
2018-04-02 00:58:08 +08:00
|
|
|
mode: 0750
|
2018-02-13 00:34:01 +08:00
|
|
|
backup: yes
|
2018-04-02 00:58:08 +08:00
|
|
|
when: etcd_cluster_setup
|
2018-03-01 16:39:14 +08:00
|
|
|
|
|
|
|
- name: Install etcd-events launch script
|
|
|
|
template:
|
|
|
|
src: etcd-events.j2
|
|
|
|
dest: "{{ bin_dir }}/etcd-events"
|
|
|
|
owner: 'root'
|
2018-04-02 00:58:08 +08:00
|
|
|
mode: 0750
|
2018-03-01 16:39:14 +08:00
|
|
|
backup: yes
|
|
|
|
when: etcd_events_cluster_setup
|