prole/infrastructure/roles/k3s/tasks/validate_args.yml
chrisfu a43aed7134 k3s: eliminate localhost registry + dedupe common-core
- Ensure k3s mode uses the k3s registry endpoint and avoid localhost/k3d image prefixes.

- Make ArgoCD repo-server cmp symlink creation idempotent.

- Normalize common-core provisioning to knoe-system and add repair-time dedupe of stray default-namespace installs.

- Add k3s MariaDB datastore/refresh playbooks and regression tests.
2026-03-05 14:31:33 -08:00

27 lines
1.0 KiB
YAML

---
# Fail fast on known-bad flags that prevent k3s from starting.
- name: Validate kube-apiserver args (known unsupported flags)
ansible.builtin.assert:
that:
- _bad_kube_apiserver_args | length == 0
fail_msg: >-
k3s_kube_apiserver_args contains unsupported flag(s): {{ _bad_kube_apiserver_args | join(', ') }}.
This can prevent k3s from starting (e.g. kube-apiserver exits with "unknown flag").
vars:
_bad_kube_apiserver_args: >-
{{
(k3s_kube_apiserver_args | default([]))
| select('search', '^etcd-timeout=')
| list
}}
- name: Validate datastore configuration (embedded etcd vs external datastore)
ansible.builtin.assert:
that:
- not ((k3s_cluster_init | default(false) | bool) and ((k3s_datastore_endpoint | default('')) | length > 0))
fail_msg: >-
Invalid k3s datastore config: k3s_cluster_init=true cannot be used with an external datastore.
Set k3s_cluster_init: false (or unset k3s_datastore_endpoint).
when: k3s_role == 'server'