2019-06-21 02:12:51 +08:00
|
|
|
---
|
|
|
|
- name: Calculate etcd cert serial
|
|
|
|
command: "openssl x509 -in {{ kube_cert_dir }}/apiserver-etcd-client.crt -noout -serial"
|
|
|
|
register: "etcd_client_cert_serial_result"
|
|
|
|
changed_when: false
|
|
|
|
tags:
|
|
|
|
- network
|
|
|
|
|
|
|
|
- name: Set etcd_client_cert_serial
|
|
|
|
set_fact:
|
|
|
|
etcd_client_cert_serial: "{{ etcd_client_cert_serial_result.stdout.split('=')[1] }}"
|
|
|
|
tags:
|
|
|
|
- network
|
|
|
|
|
2023-08-23 22:04:22 +08:00
|
|
|
- name: Ensure etcdctl and etcdutl script is installed
|
2020-11-04 16:20:04 +08:00
|
|
|
import_role:
|
2023-08-23 22:04:22 +08:00
|
|
|
name: etcdctl_etcdutl
|
2022-02-23 00:53:16 +08:00
|
|
|
when: etcd_deployment_type == "kubeadm"
|
2023-08-23 22:04:22 +08:00
|
|
|
tags:
|
|
|
|
- etcdctl
|
|
|
|
- etcdutl
|
2022-06-17 16:34:32 +08:00
|
|
|
|
|
|
|
- name: Set ownership for etcd data directory
|
|
|
|
file:
|
|
|
|
path: "{{ etcd_data_dir }}"
|
|
|
|
owner: "{{ etcd_owner }}"
|
|
|
|
group: "{{ etcd_owner }}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0700"
|
2022-06-29 00:13:58 +08:00
|
|
|
when: etcd_deployment_type == "kubeadm"
|