|
@@ -79,13 +79,6 @@
|
|
|
when: etcd_client_certs_missing | bool
|
|
|
delegate_to: "{{ etcd_ca_host }}"
|
|
|
|
|
|
-- name: Create local temp directory for syncing certs
|
|
|
- local_action: command mktemp -d /tmp/etcd_certificates-XXXXXXX
|
|
|
- register: g_etcd_client_mktemp
|
|
|
- changed_when: False
|
|
|
- when: etcd_client_certs_missing | bool
|
|
|
- become: no
|
|
|
-
|
|
|
- name: Create a tarball of the etcd certs
|
|
|
command: >
|
|
|
tar -czvf {{ etcd_generated_certs_dir }}/{{ etcd_cert_subdir }}.tgz
|
|
@@ -101,8 +94,7 @@
|
|
|
- name: Retrieve the etcd cert tarballs
|
|
|
fetch:
|
|
|
src: "{{ etcd_generated_certs_dir }}/{{ etcd_cert_subdir }}.tgz"
|
|
|
- dest: "{{ g_etcd_client_mktemp.stdout }}/"
|
|
|
- flat: yes
|
|
|
+ dest: "/tmp"
|
|
|
fail_on_missing: yes
|
|
|
validate_checksum: yes
|
|
|
when: etcd_client_certs_missing | bool
|
|
@@ -116,10 +108,15 @@
|
|
|
|
|
|
- name: Unarchive etcd cert tarballs
|
|
|
unarchive:
|
|
|
- src: "{{ g_etcd_client_mktemp.stdout }}/{{ etcd_cert_subdir }}.tgz"
|
|
|
+ src: "/tmp/{{ inventory_hostname }}/{{ etcd_generated_certs_dir }}/{{ etcd_cert_subdir }}.tgz"
|
|
|
dest: "{{ etcd_cert_config_dir }}"
|
|
|
when: etcd_client_certs_missing | bool
|
|
|
|
|
|
+- name: Delete temporary directory
|
|
|
+ local_action: file path="/tmp/{{ inventory_hostname }}" state=absent
|
|
|
+ changed_when: False
|
|
|
+ when: etcd_client_certs_missing | bool
|
|
|
+
|
|
|
- file:
|
|
|
path: "{{ etcd_cert_config_dir }}/{{ item }}"
|
|
|
owner: root
|
|
@@ -130,9 +127,3 @@
|
|
|
- "{{ etcd_cert_prefix }}client.key"
|
|
|
- "{{ etcd_cert_prefix }}ca.crt"
|
|
|
when: etcd_client_certs_missing | bool
|
|
|
-
|
|
|
-- name: Delete temporary directory
|
|
|
- local_action: file path="{{ g_etcd_client_mktemp.stdout }}" state=absent
|
|
|
- changed_when: False
|
|
|
- when: etcd_client_certs_missing | bool
|
|
|
- become: no
|