Files
turbo-mothership/ansible/netris-switches/configure-switches.yml
Pavel Basov df9937f0c3 Initial commit: Turbo Mothership bare metal management cluster
- k0s bootstrap with Cilium and OpenEBS
- ArgoCD apps for infra, CAPI, Tinkerbell, and Netris
- Ansible playbooks for virtual baremetal lab and Netris switches
- CAPI provider manifests for k0smotron and Tinkerbell
2025-12-15 19:59:58 +01:00

35 lines
1.1 KiB
YAML

---
# Configure Cumulus switches after boot
# Run this after the VMs have fully booted (give them ~2-3 minutes)
- name: Configure Cumulus Switches
hosts: localhost
gather_facts: no
vars:
all_switches: "{{ topology.spines + topology.leaves }}"
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
tasks:
- name: Wait for switches to be reachable
wait_for:
host: 127.0.0.1
port: "{{ mgmt_ssh_base_port + idx }}"
delay: 10
timeout: 300
loop: "{{ all_switches }}"
loop_control:
index_var: idx
label: "{{ item.name }}"
- name: Configure each switch
include_tasks: tasks/configure-switch.yml
vars:
switch_name: "{{ item.0.name }}"
switch_ssh_port: "{{ mgmt_ssh_base_port + item.1 }}"
switch_type: "{{ 'spine' if item.0.name.startswith('spine') else 'leaf' }}"
switch_id: "{{ item.1 }}"
loop: "{{ all_switches | zip(range(all_switches | length)) | list }}"
loop_control:
label: "{{ item.0.name }}"