The goal of this task is to implement an automated failover mechanism that ensures GRE tunnels always point to the current CARP PRIMARY.
When a router transitions to the ACTIVE state, a devd-triggered script implemented in D4033 will emit a Salt event. This event is received by the Salt master, which reacts using a reactor to trigger GRE tunnel reconfiguration on Ysul and Windriver.
The reconfiguration process will:
- Remove the existing GRE tunnel
- Recreate a new tunnel toward the new ACTIVE router
- Reload IPsec
This approach ensures that tunnel configuration dynamically follows CARP state changes, avoiding manual intervention and reducing downtime during failover events.
Steps :
- 1. Send a test Salt event from a router to validate event emission
sudo salt-call event.send 'test/carp' '{"router": "router-003"}'- 2. Verify that the event is correctly received on the Salt master event bus
salt-run state.event pretty=True
- 3. Integrate the event emission into the devd-triggered script (D4033)
- 4. Configure a test Salt reactor to listen for the carp/master event and trigger an action
- 5. Implement a script to handle GRE tunnel reconfiguration ( D4098)
- 6. Trigger the reconfiguration from the reactor upon event reception (D4098)
- 7. Test the full failover scenario (CARP switch) and validate tunnel recreation
References :
https://docs.saltproject.io/en/3007/ref/modules/all/salt.modules.event.html
https://mpolinowski.github.io/docs/DevOps/Salt/2020-06-20--salt-reactor-events/2020-06-20/