The goal of this task is to implement an automated failover mechanism that ensures GRE tunnels always point to the current CARP MASTER.
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 'carp/master' '{"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 Salt reactor to listen for the CARP MASTER event and trigger an action
- 5. Implement a script to handle GRE tunnel reconfiguration on Ysul
- 6. Trigger the reconfiguration from the reactor upon event reception
- 7. Test the full failover scenario (CARP switch) and validate tunnel recreation
- 8. Verify connectivity and routing after failover
If everything works as expected, we can then test the setup with Windriver, as GRE and CARP interactions have previously caused issues. At this stage, it is still unclear which component is responsible for the problem.
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/