blob: ae13029fdeeff97ed6fb2614c656cc51c4568816 [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_name }}
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Ingress
metadata:
name: "{{ openstack_helm_ingress_name }}"
namespace: openstack
annotations: "{{ _openstack_helm_ingress_annotations | combine(openstack_helm_ingress_annotations, recursive=True) }}"
spec:
ingressClassName: "{{ openstack_helm_ingress_class_name }}"
rules:
- host: "{{ openstack_helm_ingress_host }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "{{ openstack_helm_ingress_service_name }}"
port:
number: "{{ openstack_helm_ingress_service_port }}"
tls:
- secretName: "{{ openstack_helm_ingress_secret_name }}"
hosts:
- "{{ openstack_helm_ingress_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