summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjawed <jawed.khelil@amadeus.com>2017-01-03 16:51:49 +0100
committerJawed khelil <jkhelil@gmail.com>2017-01-27 09:04:52 +0100
commit7defef28fff0e827b2923976e3f0ff72d435e7c2 (patch)
tree1b649e1f8871f066210a2a110e54f19df509e41c
parent3e00b0082c1af7cc77957bbad9ea514874681fb1 (diff)
downloadopenshift-7defef28fff0e827b2923976e3f0ff72d435e7c2.tar.gz
openshift-7defef28fff0e827b2923976e3f0ff72d435e7c2.tar.bz2
openshift-7defef28fff0e827b2923976e3f0ff72d435e7c2.tar.xz
openshift-7defef28fff0e827b2923976e3f0ff72d435e7c2.zip
Sync etcd ca certs from etcd_ca_host to other etcd hosts
-rw-r--r--roles/etcd_server_certificates/tasks/main.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/etcd_server_certificates/tasks/main.yml b/roles/etcd_server_certificates/tasks/main.yml
index b0fd117ed..1acdf1c85 100644
--- a/roles/etcd_server_certificates/tasks/main.yml
+++ b/roles/etcd_server_certificates/tasks/main.yml
@@ -142,6 +142,38 @@
dest: "{{ etcd_cert_config_dir }}"
when: etcd_server_certs_missing | bool
+- name: Create a tarball of the etcd ca certs
+ command: >
+ tar -czvf {{ etcd_generated_certs_dir }}/{{ etcd_ca_name }}.tgz
+ -C {{ etcd_ca_dir }} .
+ args:
+ creates: "{{ etcd_generated_certs_dir }}/{{ etcd_ca_name }}.tgz"
+ warn: no
+ when: etcd_server_certs_missing | bool
+ delegate_to: "{{ etcd_ca_host }}"
+
+- name: Retrieve etcd ca cert tarball
+ fetch:
+ src: "{{ etcd_generated_certs_dir }}/{{ etcd_ca_name }}.tgz"
+ dest: "{{ g_etcd_server_mktemp.stdout }}/"
+ flat: yes
+ fail_on_missing: yes
+ validate_checksum: yes
+ when: etcd_server_certs_missing | bool
+ delegate_to: "{{ etcd_ca_host }}"
+
+- name: Ensure ca directory exists
+ file:
+ path: "{{ etcd_ca_dir }}"
+ state: directory
+ when: etcd_server_certs_missing | bool
+
+- name: Unarchive etcd ca cert tarballs
+ unarchive:
+ src: "{{ g_etcd_server_mktemp.stdout }}/{{ etcd_ca_name }}.tgz"
+ dest: "{{ etcd_ca_dir }}"
+ when: etcd_server_certs_missing | bool
+
- name: Delete temporary directory
file: name={{ g_etcd_server_mktemp.stdout }} state=absent
become: no