Mohammed Naser | b7b97d6 | 2022-03-12 16:30:00 -0500 | [diff] [blame] | 1 | # Copyright (c) 2022 VEXXHOST, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
Mohammed Naser | 2db0a22 | 2023-02-18 16:24:57 +0000 | [diff] [blame] | 15 | - name: Create wildcard certificate |
| 16 | run_once: true |
| 17 | when: openstack_helm_ingress_wildcard_domain is defined |
| 18 | block: |
| 19 | - name: Create certificate |
| 20 | kubernetes.core.k8s: |
| 21 | state: present |
| 22 | definition: |
| 23 | apiVersion: cert-manager.io/v1 |
| 24 | kind: Certificate |
| 25 | metadata: |
| 26 | name: atmosphere-wildcard |
| 27 | namespace: openstack |
| 28 | spec: |
| 29 | secretName: atmosphere-wildcard |
| 30 | issuerRef: |
| 31 | kind: ClusterIssuer |
| 32 | name: "{{ openstack_helm_ingress_cluster_issuer }}" |
| 33 | dnsNames: |
| 34 | - "*.{{ openstack_helm_ingress_wildcard_domain }}" |
| 35 | - name: Set fact with wildcard certificate |
| 36 | ansible.builtin.set_fact: |
| 37 | openstack_helm_ingress_secret_name: atmosphere-wildcard |
| 38 | |
Mohammed Naser | a5902dd | 2023-02-10 19:38:18 +0000 | [diff] [blame] | 39 | - name: Add ClusterIssuer annotations |
Mohammed Naser | 65850fd | 2023-02-22 21:36:27 -0500 | [diff] [blame] | 40 | run_once: true |
Mohammed Naser | a5902dd | 2023-02-10 19:38:18 +0000 | [diff] [blame] | 41 | ansible.builtin.set_fact: |
| 42 | _openstack_helm_ingress_annotations: "{{ _openstack_helm_ingress_annotations | combine(annotations, recursive=True) }}" |
| 43 | vars: |
| 44 | annotations: |
| 45 | cert-manager.io/cluster-issuer: "{{ openstack_helm_ingress_cluster_issuer }}" |
| 46 | when: openstack_helm_ingress_secret_name is not defined |
| 47 | |
Mohammed Naser | b07e905 | 2023-01-12 22:19:13 -0500 | [diff] [blame] | 48 | - name: Create Ingress {{ openstack_helm_ingress_name }} |
Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 49 | ansible.builtin.include_role: |
| 50 | name: ingress |
| 51 | vars: |
| 52 | ingress_annotations: "{{ _openstack_helm_ingress_annotations | combine(openstack_helm_ingress_annotations, recursive=True) }}" |
| 53 | ingress_name: "{{ openstack_helm_ingress_name }}" |
| 54 | ingress_namespace: openstack |
| 55 | ingress_host: "{{ openstack_helm_ingress_host }}" |
| 56 | ingress_service_name: "{{ openstack_helm_ingress_service_name }}" |
| 57 | ingress_service_port: "{{ openstack_helm_ingress_service_port }}" |
| 58 | ingress_secret_name: "{{ openstack_helm_ingress_secret_name | default(openstack_helm_ingress_service_name ~ '-certs') }}" |
Mohammed Naser | c139abc | 2025-02-05 14:03:20 -0500 | [diff] [blame] | 59 | ingress_class_name: "{{ openstack_helm_ingress_class_name }}" |