Browse Source

Bug 1511044- Slurp the etcd certs instead of using the lookup

Fabian von Feilitzsch 7 years ago
parent
commit
40aa9376db
1 changed files with 12 additions and 3 deletions
  1. 12 3
      roles/ansible_service_broker/tasks/generate_certs.yml

+ 12 - 3
roles/ansible_service_broker/tasks/generate_certs.yml

@@ -29,7 +29,16 @@
   - set_fact:
       ansible_service_broker_certs_dir: "{{ openshift.common.config_base }}/ansible-service-broker"
 
+- name: Read in certs for etcd
+  slurp:
+    src: '{{ ansible_service_broker_certs_dir }}/{{ item }}'
+  register: asb_etcd_certs
+  with_items:
+  - cert.pem
+  - client.pem
+  - client.key
+
 - set_fact:
-    etcd_ca_cert: "{{ lookup('file', '{{ ansible_service_broker_certs_dir }}/cert.pem') }}"
-    etcd_client_cert: "{{ lookup('file', '{{ ansible_service_broker_certs_dir }}/client.pem') }}"
-    etcd_client_key: "{{ lookup('file', '{{ ansible_service_broker_certs_dir }}/client.key') }}"
+    etcd_ca_cert: "{{ asb_etcd_certs.results.0.content | b64decode }}"
+    etcd_client_cert: "{{ asb_etcd_certs.results.1.content | b64decode }}"
+    etcd_client_key: "{{ asb_etcd_certs.results.2.content | b64decode }}"