diff options
author | jawed <jawed.khelil@amadeus.com> | 2017-01-03 16:51:49 +0100 |
---|---|---|
committer | Jawed khelil <jkhelil@gmail.com> | 2017-01-27 09:04:52 +0100 |
commit | 7defef28fff0e827b2923976e3f0ff72d435e7c2 (patch) | |
tree | 1b649e1f8871f066210a2a110e54f19df509e41c | |
parent | 3e00b0082c1af7cc77957bbad9ea514874681fb1 (diff) | |
download | openshift-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.yml | 32 |
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 |