Initial commit
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
- name: Validate Owncast configuration
|
||||
ansible.builtin.import_tasks: validate.yml
|
||||
|
||||
- name: Create Owncast namespace
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: "{{ owncast_namespace }}"
|
||||
|
||||
- name: Create Owncast persistent volume claim
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('ansible.builtin.template', 'pvc.yml.j2') | from_yaml }}"
|
||||
when: owncast_existing_claim | length == 0
|
||||
|
||||
- name: Deploy Owncast workload and service
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('ansible.builtin.template', item) | from_yaml }}"
|
||||
loop:
|
||||
- deployment.yml.j2
|
||||
- service.yml.j2
|
||||
|
||||
- name: Deploy Owncast ingress
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('ansible.builtin.template', 'ingress.yml.j2') | from_yaml }}"
|
||||
when: owncast_ingress_enabled | bool
|
||||
|
||||
- name: Deploy Owncast onion service
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
definition: "{{ lookup('ansible.builtin.template', 'onion.yml.j2') | from_yaml }}"
|
||||
when: owncast_onion_enabled | bool
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Validate Owncast identity and service settings
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- owncast_namespace is match('^[a-z0-9]([-a-z0-9]*[a-z0-9])?$')
|
||||
- owncast_namespace | length <= 63
|
||||
- owncast_name is match('^[a-z]([-a-z0-9]*[a-z0-9])?$')
|
||||
- owncast_name | length <= 63
|
||||
- owncast_pvc_name is match('^[a-z0-9]([-a-z0-9.]*[a-z0-9])?$')
|
||||
- owncast_pvc_name | length <= 253
|
||||
- owncast_image | length > 0
|
||||
- owncast_service_type in ['ClusterIP', 'NodePort', 'LoadBalancer']
|
||||
- owncast_external_traffic_policy in ['Local', 'Cluster']
|
||||
- owncast_image_pull_policy in ['Always', 'IfNotPresent', 'Never']
|
||||
- owncast_resources is mapping
|
||||
- owncast_service_annotations is mapping
|
||||
- owncast_ingress_annotations is mapping
|
||||
- owncast_load_balancer_source_ranges is sequence
|
||||
- owncast_load_balancer_source_ranges is not string
|
||||
fail_msg: Invalid Owncast resource identity, image, resources, or service settings.
|
||||
|
||||
- name: Validate Owncast ingress settings
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- owncast_hostname | length > 0
|
||||
- owncast_hostname | length <= 253
|
||||
- owncast_hostname is match('^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$')
|
||||
- not (owncast_tls_enabled | bool) or owncast_tls_secret_name | length > 0
|
||||
- owncast_cluster_issuer | length == 0 or owncast_tls_enabled | bool
|
||||
fail_msg: Ingress requires a DNS hostname and, for TLS, a secret name. An issuer requires TLS.
|
||||
when: owncast_ingress_enabled | bool
|
||||
Reference in New Issue
Block a user