Skip to content

Commit b361165

Browse files
committed
Update custom ca certs hook
The hook was supposed to create a secret with custom ca certs and also update the Openstack control-plane to use it. This approach has brought some issues with the control-plane restarting, so we want to change the approach to creating the secret only. The use of the secret will be done separately.
1 parent 1638776 commit b361165

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed
Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
---
2-
- name: Set up custom CA secret for OpenStack control plane
2+
- name: Prepare custom CA secret
33
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
44
gather_facts: false
5+
connection: local
56
vars:
6-
_custom_ca_cert_filepath: "{{ custom_ca_cert_filepath | mandatory }}"
7+
_custom_ca_cert_url: "{{ custom_ca_cert_url | mandatory }}"
78
_namespace: "{{ namespace | default('openstack') }}"
8-
_controlplane_name: "{{ controlplane_name | default('controlplane') }}"
99
tasks:
10+
- name: Download Cert
11+
ansible.builtin.get_url:
12+
url: "{{ _custom_ca_cert_url }}"
13+
dest: '/tmp/ca_cert.txt'
14+
register: download_status
15+
until: download_status is not failed and (download_status.status_code is undefined or download_status.status_code == 200)
16+
retries: 10
17+
delay: 5
18+
1019
- name: Read custom CA certificate file
1120
ansible.builtin.slurp:
12-
src: "{{ _custom_ca_cert_filepath }}"
21+
src: "/tmp/ca_cert.txt"
1322
register: custom_ca_certs
1423

1524
- name: Create custom CA secret
1625
kubernetes.core.k8s:
26+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
1727
state: present
1828
definition:
1929
apiVersion: v1
@@ -24,17 +34,3 @@
2434
namespace: "{{ _namespace }}"
2535
data:
2636
CustomCACerts: "{{ custom_ca_certs.content }}"
27-
28-
- name: Patch OpenStack control plane to use custom CA secret
29-
kubernetes.core.k8s:
30-
state: patched
31-
kind: OpenStackControlPlane
32-
api_version: core.openstack.org/v1beta1
33-
name: "{{ _controlplane_name }}"
34-
namespace: "{{ _namespace }}"
35-
definition:
36-
spec:
37-
tls:
38-
podLevel:
39-
enabled: true
40-
caBundleSecretName: custom-ca-certs

0 commit comments

Comments
 (0)