blob: ee9e0f7c7448690b886457b2dd1fecde42fb0557 [file] [log] [blame]
Mohammed Naserb7b97d62022-03-12 16:30:00 -05001# 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 Naser2db0a222023-02-18 16:24:57 +000015- 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 Nasera5902dd2023-02-10 19:38:18 +000039- name: Add ClusterIssuer annotations
Mohammed Naser65850fd2023-02-22 21:36:27 -050040 run_once: true
Mohammed Nasera5902dd2023-02-10 19:38:18 +000041 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 Naserb07e9052023-01-12 22:19:13 -050048- name: Create Ingress {{ openstack_helm_ingress_name }}
Oleksandr Kozachenkob0093492023-09-06 21:43:47 +020049 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 Naserc139abc2025-02-05 14:03:20 -050059 ingress_class_name: "{{ openstack_helm_ingress_class_name }}"