Skip to content

Commit c34fc08

Browse files
authored
Merge pull request validatedpatterns#286 from mbaldessari/letsencrypt-prep-work
Prep Work for letsencrypt support
2 parents 3f38981 + 1e69787 commit c34fc08

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ansible/roles/vault_utils/tasks/vault_spokes_init.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
- name: Merge the two dicts together
4747
ansible.builtin.set_fact:
48-
clusters_info: "{{ clusters | combine(cleaned_acm_secrets, recursive=True) }}"
48+
clusters_info: "{{ clusters | default({}) | combine(cleaned_acm_secrets, recursive=True) }}"
4949

5050
- name: Write out CAs
5151
ansible.builtin.copy:
@@ -57,6 +57,13 @@
5757
loop_control:
5858
label: "{{ item.key }}"
5959

60+
# FIXME(bandini): validate_certs is false due to an ACM bug when using
61+
# letsencrypt certificates with API endpoints: https://issues.redhat.com/browse/ACM-4398
62+
# We always verify the CA chain except when letsencrypt.api_endpoint is set to true
63+
- name: If we are using letsencrypt on the API endpoints we cannot use the validate_certs later
64+
ansible.builtin.set_fact:
65+
validate_certs_api_endpoint: "{{ not letsencrypt.api_endpoint | default(True) | bool }}"
66+
6067
- name: Fetch remote ansible to remote cluster
6168
kubernetes.core.k8s_info:
6269
api_key: "{{ item.value['bearerToken'] }}"
@@ -66,6 +73,7 @@
6673
namespace: "{{ external_secrets_ns }}"
6774
name: "{{ external_secrets_secret }}"
6875
api_version: v1
76+
validate_certs: "{{ validate_certs_api_endpoint }}"
6977
register: remote_external_secrets_sa
7078
when:
7179
- clusters_info[item.key]['bearerToken'] is defined

0 commit comments

Comments
 (0)