mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-26 10:43:04 +01:00
Added verify_config.yml playbook and included it in site.yml, Updated README.md with config verifications for ip routing prefix and metal_lb_ip_range checks etc
This commit is contained in:
13
roles/verify_config/tasks/main.yml
Normal file
13
roles/verify_config/tasks/main.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# To be ran on localhost after verify_config_gather role.
|
||||
# Verifies gatherd facts.
|
||||
- name: Collect all routing4_prefixes into a list
|
||||
set_fact:
|
||||
all_routing4_prefixes: "{{ groups['all'] | map('extract', hostvars, 'routing4_prefix') | list }}"
|
||||
routing4_prefix: "{{ groups['all'] | map('extract', hostvars, 'routing4_prefix') | list | first }}"
|
||||
|
||||
- name: Ensure all hosts have the same routing4_prefix
|
||||
assert:
|
||||
that: all_routing4_prefixes | unique | length == 1
|
||||
fail_msg: "Not all hosts have the same routing4_prefix."
|
||||
success_msg: "Using verified routing prefix {{ routing4_prefix }} across all hosts"
|
||||
Reference in New Issue
Block a user