Skip to content

Commit

Permalink
Apply new openstack-operator config
Browse files Browse the repository at this point in the history
  • Loading branch information
xek committed Mar 20, 2024
1 parent 38fa91b commit 2c4f501
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 41 deletions.
15 changes: 11 additions & 4 deletions tests/config/base/openstack_control_plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ spec:
storageClass: local-storage

tls:
endpoint:
podLevel:
enabled: true
internal:
enabled: true
public:
enabled: true
ca:
customIssuer: rootca-internal
ovn:
ca:
customIssuer: rootca-internal
ingress:
ca:
customIssuer: rootca-internal
enabled: true

barbican:
enabled: false
Expand Down
2 changes: 2 additions & 0 deletions tests/roles/ovn_adoption/handlers/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
{{ oc_header }}
oc delete pod ovn-copy-data
{% if storage_reclaim_policy.lower() == "delete" %}oc delete pvc ovn-data{% endif %}
oc delete certificate ovn-data-cert
oc delete secret ovn-data-cert
2 changes: 2 additions & 0 deletions tests/roles/pcp_cleanup/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
oc delete --wait=false pod ovn-copy-data || true
oc delete secret osp-secret || true
oc delete issuer rootca-internal --ignore-not-found
oc delete secret rootca-internal --ignore-not-found
when: pcp_cleanup_enabled|bool

- name: revert standalone VM to snapshotted state
Expand Down
43 changes: 6 additions & 37 deletions tests/roles/tls_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,29 @@
- name: patch rootca-internal with cert and key from IPA
- name: Create Certificate Issuer with cert and key from IPA
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
IPA_SSH="{{ ipa_ssh }}"
$IPA_SSH pk12util -o /tmp/freeipa.p12 -n 'caSigningCert\ cert-pki-ca' -d /etc/pki/pki-tomcat/alias -k /etc/pki/pki-tomcat/alias/pwdfile.txt -w /etc/pki/pki-tomcat/alias/pwdfile.txt
KEY_LENGTH=`$IPA_SSH openssl pkcs12 -in /tmp/freeipa.p12 -passin file:/etc/pki/pki-tomcat/alias/pwdfile.txt -nocerts -noenc | openssl rsa -text -noout | awk -F'[^0-9]+' '{ print $2; exit }'`
oc apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: openstack
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: openstack
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: rootca-internal
namespace: openstack
spec:
isCA: true
commonName: rootca-internal
secretName: rootca-internal
privateKey:
algorithm: RSA
size: $KEY_LENGTH
issuerRef:
name: selfsigned-issuer
EOF
oc create secret generic rootca-internal
oc wait --for=condition=ready --timeout=60s -n openstack certificate rootca-internal
oc patch secret rootca-internal -n openstack -p="{\"data\":{\"ca.crt\": \"`$IPA_SSH openssl pkcs12 -in /tmp/freeipa.p12 -passin file:/etc/pki/pki-tomcat/alias/pwdfile.txt -nokeys | openssl x509 | base64 -w 0`\"}}"
oc patch secret rootca-internal -n openstack -p="{\"data\":{\"tls.crt\": \"`$IPA_SSH openssl pkcs12 -in /tmp/freeipa.p12 -passin file:/etc/pki/pki-tomcat/alias/pwdfile.txt -nokeys | openssl x509 | base64 -w 0`\"}}"
oc patch secret rootca-internal -n openstack -p="{\"data\":{\"tls.key\": \"`$IPA_SSH openssl pkcs12 -in /tmp/freeipa.p12 -passin file:/etc/pki/pki-tomcat/alias/pwdfile.txt -nocerts -noenc | openssl rsa | base64 -w 0`\"}}"
oc apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: openstack
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: rootca-internal
namespace: openstack
labels:
osp-rootca-issuer-public: ""
osp-rootca-issuer-internal: ""
osp-rootca-issuer-ovn: ""
spec:
ca:
secretName: rootca-internal
Expand Down

0 comments on commit 2c4f501

Please sign in to comment.