diff options
author | Andrew Butcher <abutcher@afrolegs.com> | 2017-02-01 11:17:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-01 11:17:54 -0500 |
commit | 5990accbc3e82a8a8ceb4c8b719b12bc2cda4c80 (patch) | |
tree | 801ce812c36b3a2775857f226cfb26effe0b26ec | |
parent | 75efc666ba792e2a29ad5d9ee71a9e9657c93d20 (diff) | |
parent | 7defef28fff0e827b2923976e3f0ff72d435e7c2 (diff) | |
download | openshift-5990accbc3e82a8a8ceb4c8b719b12bc2cda4c80.tar.gz openshift-5990accbc3e82a8a8ceb4c8b719b12bc2cda4c80.tar.bz2 openshift-5990accbc3e82a8a8ceb4c8b719b12bc2cda4c80.tar.xz openshift-5990accbc3e82a8a8ceb4c8b719b12bc2cda4c80.zip |
Merge pull request #3031 from jkhelil/sync_etcd_ca_certs
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 |