blob: 8ba0a528885b5531d00fd9de8edc45603afacb52 [file] [log] [blame]
# Copyright (c) 2022 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Create Ingress {{ openstack_helm_ingress_endpoint }}
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Ingress
metadata:
name: "{{ openstack_helm_ingress_endpoint | replace('_', '-') }}"
namespace: openstack
annotations: "{{ _openstack_helm_ingress_annotations | combine(openstack_helm_ingress_annotations, recursive=True) }}"
spec:
ingressClassName: "{{ openstack_helm_ingress_class_name | default('openstack') }}"
rules:
- host: "{{ openstack_helm_endpoints[openstack_helm_ingress_endpoint]['host_fqdn_override']['public']['host'] }}"
http:
paths: "{{ _openstack_helm_ingress_paths }}"
tls:
- secretName: "{{ openstack_helm_ingress_secret_name | default(openstack_helm_ingress_service_name + '-certs') }}"
hosts:
- "{{ openstack_helm_endpoints[openstack_helm_ingress_endpoint]['host_fqdn_override']['public']['host'] }}"
# NOTE(mnaser): The Atmosphere operator is so fast that the Ingress webhook
# is not up yet by the time we run this for the first time, so
# we retry until we let the operator handle creating the ingress.
retries: 60
delay: 5
register: _result
until: _result is not failed