From de57975786f80b6aff8d3145071277c05359e79c Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Tue, 8 Oct 2019 10:02:50 -0230 Subject: [PATCH] Handle empty cert related hostvar info When certificates are neither generated nor provided (e.g. on update) related variables would be empty or undefined and need to be handled accordingly. Note: this file has been relocated to triple-ansible in train+ so this is a non-trivial backport of I361c90e438e79e180e2a745da82e619347fed13e. Change-Id: I6afe5078bd285374b3a9311a066ba10883c2ff66 Closes-Bug: #1845366 --- playbooks/octavia-files.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/octavia-files.yaml b/playbooks/octavia-files.yaml index 68f01444c..31c347628 100644 --- a/playbooks/octavia-files.yaml +++ b/playbooks/octavia-files.yaml @@ -63,9 +63,9 @@ octavia_confd_prefix: "/var/lib/config-data/puppet-generated/octavia" lb_mgmt_net_id: "{{ hostvars[groups['octavia_nodes'][0]]['lb_mgmt_net_id'] }}" lb_mgmt_secgroup_id: "{{ hostvars[groups['octavia_nodes'][0]]['lb_mgmt_secgroup_id'] }}" - private_key_content: "{{ hostvars[groups['octavia_nodes'][0]]['private_key_content'] }}" - ca_cert_content: "{{ hostvars[groups['octavia_nodes'][0]]['ca_cert_content'] }}" - service_pem_content: "{{ hostvars[groups['octavia_nodes'][0]]['service_pem_content'] }}" + private_key_content: "{{ hostvars[groups['octavia_nodes'][0]]['private_key_content'] | default('') }}" + ca_cert_content: "{{ hostvars[groups['octavia_nodes'][0]]['ca_cert_content'] | default('') }}" + service_pem_content: "{{ hostvars[groups['octavia_nodes'][0]]['service_pem_content'] | default('') }}" generate_certs: "{{ generate_certs }}" ca_cert_path: "{{ ca_cert_path }}" ca_private_key_path: "{{ ca_private_key_path }}"