mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-26 02:32:59 +01:00
14 lines
626 B
YAML
14 lines
626 B
YAML
---
|
|
# 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"
|