kubespray/roles/kubernetes/control-plane/tasks/kubeadm-etcd.yml

30 lines
760 B
YAML
Raw Normal View History

---
- 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
- name: Ensure etcdctl and etcdutl script is installed
import_role:
name: etcdctl_etcdutl
when: etcd_deployment_type == "kubeadm"
tags:
- etcdctl
- etcdutl
- name: Set ownership for etcd data directory
file:
path: "{{ etcd_data_dir }}"
owner: "{{ etcd_owner }}"
group: "{{ etcd_owner }}"
mode: "0700"
when: etcd_deployment_type == "kubeadm"