From 2beffe688abfccfc4ea00a69ab35b7156fc33ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hus=C3=A1k?= Date: Fri, 6 Mar 2020 11:05:23 +0100 Subject: [PATCH] Make etcdctl connect to localhost out of the box (#5643) * Make etcdctl connect to localhost out of the box * etcdctl envs: use admin-.pem instead of member-.pem --- roles/etcd/templates/etcd.env.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/etcd/templates/etcd.env.j2 b/roles/etcd/templates/etcd.env.j2 index a46a73948..6cd760405 100644 --- a/roles/etcd/templates/etcd.env.j2 +++ b/roles/etcd/templates/etcd.env.j2 @@ -42,3 +42,9 @@ ETCD_PEER_CLIENT_CERT_AUTH={{ etcd_peer_client_auth }} {% if host_architecture != "amd64" -%} ETCD_UNSUPPORTED_ARCH={{host_architecture}} {%- endif %} + +# CLI settings +ETCDCTL_ENDPOINTS=https://127.0.0.1:2379 +ETCDCTL_CA_FILE={{ etcd_cert_dir }}/ca.pem +ETCDCTL_KEY_FILE={{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem +ETCDCTL_CERT_FILE={{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem