mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 10:13:58 +00:00
36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
---
|
|
- name: Test - k3s argument validation (local)
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Validation should fail when a known-bad arg is present (etcd-timeout)
|
|
block:
|
|
- name: Run validation with a bad arg (expected to fail)
|
|
ansible.builtin.include_role:
|
|
name: k3s
|
|
tasks_from: validate_args
|
|
vars:
|
|
k3s_kube_apiserver_args:
|
|
- "etcd-timeout=50s"
|
|
rescue:
|
|
- name: Mark expected failure as observed
|
|
ansible.builtin.set_fact:
|
|
_bad_arg_validation_failed: true
|
|
|
|
always:
|
|
- name: Assert the bad-arg validation failed as expected
|
|
ansible.builtin.assert:
|
|
that:
|
|
- _bad_arg_validation_failed | default(false) | bool
|
|
|
|
- name: Validation should pass with supported args
|
|
ansible.builtin.include_role:
|
|
name: k3s
|
|
tasks_from: validate_args
|
|
vars:
|
|
k3s_kube_apiserver_args:
|
|
- "request-timeout=10s"
|
|
- "min-request-timeout=10"
|