kedge/ansible/playbooks/failover-test.yml
Tyler King 6058e62348 Initial commit: Kedge network automation platform
Go-based network automation with YANG models, gRPC, Ansible,
Terraform, and Kubernetes integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:09:30 -05:00

31 lines
1 KiB
YAML

---
# Simulate primary WAN failure and verify OOB path survivability.
- name: WAN failover test
hosts: homelab
become: true
tasks:
- name: Record current WireGuard peer status
ansible.builtin.command:
cmd: wg show wg0
register: wg_before
changed_when: false
- name: Display pre-failover state
ansible.builtin.debug:
var: wg_before.stdout_lines
# NOTE: Actual failover simulation (iptables rules to block primary WAN)
# is too destructive for automated runs. This playbook verifies the
# monitoring and detection components are working.
- name: Check Kedge DaemonSet dead peer detection
ansible.builtin.uri:
url: "http://localhost:{{ kedge_metrics_port }}/metrics"
return_content: true
register: metrics
- name: Verify mesh peer metrics exist
ansible.builtin.assert:
that:
- "'kedge_mesh_peer_count' in metrics.content"
fail_msg: "Mesh peer metrics not found — DaemonSet may not be running"