45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
# SPDX-License-Identifier: MIT-0
|
|
---
|
|
- name: Validate public website configuration
|
|
ansible.builtin.assert:
|
|
that:
|
|
- www_hostname is match('^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$')
|
|
- www_namespace is match('^[a-z0-9]([a-z0-9-]*[a-z0-9])?$')
|
|
fail_msg: Use a DNS hostname and a Kubernetes namespace without URL paths or credentials.
|
|
|
|
- name: Ensure website namespace
|
|
kubernetes.core.k8s:
|
|
state: present
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: "{{ www_namespace }}"
|
|
|
|
- name: Deploy membership prerequisites and workloads
|
|
ansible.builtin.include_tasks: membership.yml
|
|
when: www_membership_enabled | bool
|
|
|
|
- name: Render Apache membership proxy configuration
|
|
ansible.builtin.set_fact:
|
|
_www_proxy_config: "{{ lookup('ansible.builtin.template', 'membership-httpd.conf.j2') }}"
|
|
|
|
- name: Deploy Apache, public services, storage and ingress
|
|
kubernetes.core.k8s:
|
|
state: present
|
|
definition: "{{ lookup('ansible.builtin.template', 'website.yml.j2') | from_yaml_all | list }}"
|
|
|
|
- name: Wait for Apache rollout
|
|
kubernetes.core.k8s_info:
|
|
api_version: apps/v1
|
|
kind: Deployment
|
|
name: httpd
|
|
namespace: "{{ www_namespace }}"
|
|
wait: true
|
|
wait_timeout: "{{ www_wait_timeout }}"
|
|
wait_condition:
|
|
type: Available
|
|
status: "True"
|
|
when: not ansible_check_mode
|
|
|