Page MenuHomeDevCentral

Configure CARP on routers
Needs ReviewPublic

Authored by yousra on Mon, Mar 2, 15:52.
Tags
None
Referenced Files
F24678378: D3986.diff
Wed, Mar 4, 18:52
F24675861: D3986.diff
Wed, Mar 4, 14:49
F24673692: D3986.id.diff
Wed, Mar 4, 13:20
F24670206: D3986.id10339.diff
Wed, Mar 4, 08:58
F24670104: D3986.id10340.diff
Wed, Mar 4, 08:55
Unknown Object (File)
Tue, Mar 3, 07:02
Unknown Object (File)
Tue, Mar 3, 05:51
Unknown Object (File)
Tue, Mar 3, 05:48
Subscribers
None

Details

Summary

Add router CARP configuration using Jinja template and Salt state to deploy with Salt the CARP configuration.

Ref T2264

Test Plan

Apply state on router-002 and router-003 and verify CARP alias is configured.

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Skipped
Unit
No Test Coverage
Branch
role-router
Build Status
Buildable 6388
Build 6672: arc lint + arc unit

Event Timeline

yousra requested review of this revision.Mon, Mar 2, 15:52
yousra created this revision.

Using a separate file like /etc/rc.conf.d/netif/carp keeps the CARP configuration isolated,
avoids modifying the main /etc/rc.conf, and makes the setup cleaner and safer.
It improves maintainability, reduces the risk of conflicts, and ensures a more modular infrastructure design.

dereckson edited the test plan for this revision. (Show Details)
dereckson retitled this revision from Add CARP configuration in role/router/carp/carp.sls to Add CARP configuration.
dereckson retitled this revision from Add CARP configuration to Configure CARP on routers.

Configuration logic. Looks good to me.

Style: tiny bits of styling comments to help to maintain the configuration.

roles/router/carp/carp.jinja
6
  • Move this file to a subdirectory
  • Perhaps we can use "carp.rc" as filename, so we know it's to configure rc? .jinja extension is only useful to avoid linters on .sh .py etc. to analyse jinja templates as shell script or Python script. For configuration file, that's a problem we don't have
  • Add here the path to that file

Example of header:

# Source file: roles/router/carp/files/carp.rc

(so source_path won't be useful, as (1) currently, we can focus on FreeBSD-only for CARP implementation (2) other OS would have received another configuration file as source, so it would have received the source from that file)

9

You can merge the two blocks.

23

ops/secrets/ is addded automatically by credentials.get_password (that's the prefix shared by all the secrets provisioned through Salt).

29

Extra blank line, you can use pre-commit (make in your repository) to catch them.

roles/router/carp/carp.sls
7

One extra line

Added some changes :

  • no "ops/secrets/" because it is the prefixe for secrets that salt knows
  • no extrat blank line
  • Source file: roles/router/carp/files/carp.rc
  • carp.jinja ==> carp.rc into a new subfolder /files

Changed the source path in carp.sls into : source: salt://roles/router/carp/files/carp.rc