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