2015-10-03 20:19:50 +00:00
|
|
|
---
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: check_certs.yml
|
2017-02-08 21:41:36 +00:00
|
|
|
when: cert_management == "script"
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- etcd-secrets
|
|
|
|
- facts
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-11-10 16:51:24 +00:00
|
|
|
- include_tasks: "gen_certs_script.yml"
|
|
|
|
when:
|
|
|
|
- cert_management |d('script') == "script"
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- etcd-secrets
|
2017-02-08 21:41:36 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: upd_ca_trust.yml
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- etcd-secrets
|
2017-08-30 13:03:22 +00:00
|
|
|
|
2017-09-01 06:02:23 +00:00
|
|
|
- name: "Gen_certs | Get etcd certificate serials"
|
2018-10-16 06:48:12 +00:00
|
|
|
command: "openssl x509 -in {{ etcd_cert_dir }}/node-{{ inventory_hostname }}.pem -noout -serial"
|
2017-10-11 18:47:11 +00:00
|
|
|
register: "etcd_client_cert_serial_result"
|
2017-10-25 20:19:40 +00:00
|
|
|
changed_when: false
|
2022-03-02 17:29:14 +00:00
|
|
|
check_mode: no
|
2018-11-01 12:50:26 +00:00
|
|
|
when:
|
2021-04-29 12:20:50 +00:00
|
|
|
- inventory_hostname in groups['k8s_cluster']|union(groups['calico_rr']|default([]))|unique|sort
|
2018-07-06 06:12:13 +00:00
|
|
|
tags:
|
|
|
|
- master
|
|
|
|
- network
|
2017-10-11 18:47:11 +00:00
|
|
|
|
|
|
|
- name: Set etcd_client_cert_serial
|
|
|
|
set_fact:
|
2018-10-16 06:48:12 +00:00
|
|
|
etcd_client_cert_serial: "{{ etcd_client_cert_serial_result.stdout.split('=')[1] }}"
|
2018-11-01 12:50:26 +00:00
|
|
|
when:
|
2021-04-29 12:20:50 +00:00
|
|
|
- inventory_hostname in groups['k8s_cluster']|union(groups['calico_rr']|default([]))|unique|sort
|
2018-07-06 06:12:13 +00:00
|
|
|
tags:
|
|
|
|
- master
|
|
|
|
- network
|
2017-09-01 06:02:23 +00:00
|
|
|
|
2018-01-29 11:37:48 +00:00
|
|
|
- include_tasks: "install_{{ etcd_deployment_type }}.yml"
|
2016-11-09 10:31:12 +00:00
|
|
|
when: is_etcd_master
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- upgrade
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-03-30 22:06:32 +00:00
|
|
|
- include_tasks: configure.yml
|
2018-04-01 16:58:08 +00:00
|
|
|
when: is_etcd_master
|
2017-02-17 21:22:34 +00:00
|
|
|
|
2018-03-30 22:06:32 +00:00
|
|
|
- include_tasks: refresh_config.yml
|
2018-04-01 16:58:08 +00:00
|
|
|
when: is_etcd_master
|
2016-01-23 17:26:07 +00:00
|
|
|
|
2017-03-03 20:30:37 +00:00
|
|
|
- name: Restart etcd if certs changed
|
2022-03-12 02:08:23 +00:00
|
|
|
command: /bin/true
|
|
|
|
notify: restart etcd
|
2018-04-01 16:58:08 +00:00
|
|
|
when: is_etcd_master and etcd_cluster_setup and etcd_secret_changed|default(false)
|
2017-01-13 11:43:43 +00:00
|
|
|
|
2018-04-01 16:58:08 +00:00
|
|
|
- name: Restart etcd-events if certs changed
|
2022-03-12 02:08:23 +00:00
|
|
|
command: /bin/true
|
|
|
|
notify: restart etcd
|
2018-04-01 16:58:08 +00:00
|
|
|
when: is_etcd_master and etcd_events_cluster_setup and etcd_secret_changed|default(false)
|
2018-03-01 08:39:14 +00:00
|
|
|
|
2016-05-27 09:55:52 +00:00
|
|
|
# After etcd cluster is assembled, make sure that
|
|
|
|
# initial state of the cluster is in `existing`
|
2018-11-10 14:53:58 +00:00
|
|
|
# state instead of `new`.
|
2018-03-30 22:06:32 +00:00
|
|
|
- include_tasks: refresh_config.yml
|
2018-04-01 16:58:08 +00:00
|
|
|
when: is_etcd_master
|