Add router CARP configuration using Jinja template and Salt state to deploy with Salt the CARP configuration.
Ref T2264
Differential D3986
Configure CARP on routers Authored by yousra on Mon, Mar 2, 15:52. Tags None Referenced Files
Subscribers None
Details
Add router CARP configuration using Jinja template and Salt state to deploy with Salt the CARP configuration. Ref T2264 Apply state on router-002 and router-003 and verify CARP alias is configured.
Diff Detail
Event TimelineComment Actions Using a separate file like /etc/rc.conf.d/netif/carp keeps the CARP configuration isolated, Comment Actions Configuration logic. Looks good to me. Style: tiny bits of styling comments to help to maintain the configuration.
Comment Actions Added some changes :
Comment Actions Changed the source path in carp.sls into : source: salt://roles/router/carp/files/carp.rc Comment Actions Fix : we need to use context to call the function get_carp_entries on carp.sls Comment Actions OK, nice work, ready. We now need to indicate to Salt how to find carp unit if we do salt router-002 state.apply roles/router or salt router-002 state.highstate. To include router role in the highstate To fix router role logic Include logic is currently: If you rename roles/router/carp/carp.sls to roles/router/carp/init.sls that works. (If you needed a more complex logic, you could have created roles/router/carp/init.sls and do an include there, but for one file, init is enough.) Comment Actions vmx0 is not always releated to the network intranought, so I add entry["interface_name"] = interface_name Comment Actions Add routers on top.sls to be able to do a command like sudo salt 'router-002' state.apply roles/router We must then fix role routeur logic by renaming roles/router/carp/carp.sls to roles/router/carp/init.sls that works. Include logic is currently: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||