ansible: Deploy combined key+cert for haproxy
authorKienan Stewart <kstewart@efficios.com>
Tue, 23 Jan 2024 18:53:30 +0000 (13:53 -0500)
committerKienan Stewart <kstewart@efficios.com>
Tue, 23 Jan 2024 18:53:30 +0000 (13:53 -0500)
Change-Id: I7cbb2dee54b8322b1acbcfd440cbbf1efce302d6
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
automation/ansible/roles/common/tasks/certs.yml

index 462e76472b3f554f710448f22511f20647584a0b..b306cb54bea14afc18a1a4329ec7b6e132320544 100644 (file)
@@ -6,6 +6,7 @@
     owner: 'root'
     group: 'root'
     src: 'internal.efficios.com.pem'
+  register: cert
 - name: Deploy internal certificate key
   ansible.builtin.copy:
     dest: /etc/ssl/private/internal.efficios.com.key
@@ -13,3 +14,9 @@
     owner: 'root'
     group: 'root'
     content: "{{lookup('community.general.bitwarden', 'TLS Certificate internal.efficios.com', collection_id='35c5d8b1-2520-4450-a479-aef50131b930')[0]['notes'] }}"
+  register: key
+- name: Deploy combined cert+key
+  # haproxy uses a combined certificate and key file
+  when: cert.changed or key.changed
+  ansible.builtin.shell:
+    cmd: 'cat /etc/ssl/certs/internal.efficios.com.pem /etc/ssl/private/internal.efficios.com.key > /etc/ssl/private/internal.efficios.com.pem'
This page took 0.024778 seconds and 4 git commands to generate.