Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node name magic variable #1931

Open
hellt opened this issue Mar 7, 2024 · 1 comment
Open

Node name magic variable #1931

hellt opened this issue Mar 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@hellt
Copy link
Member

hellt commented Mar 7, 2024

Add a new magic variable __clabNodeName__ that would be possible to use in the node definition section to turn this:

    dcgw1_dc1:
      kind: nokia_sros
      startup-config: configs/dcgw1_dc1.partial.cfg

    dcgw2_dc1:
      kind: nokia_sros
      startup-config: configs/dcgw2_dc1.partial.cfg

into this

    dcgw1_dc1:
      kind: nokia_sros
      startup-config: configs/__clabNodeName__.partial.cfg

    dcgw2_dc1:
      kind: nokia_sros
      startup-config: configs/__clabNodeName__.partial.cfg

Bonus points if that would also work in kinds/defaults:

  kinds:
    nokia_sros:
      startup-config: configs/__clabNodeName__.partial.cfg

    dcgw1_dc1:
      kind: nokia_sros

    dcgw2_dc1:
      kind: nokia_sros

see __clabNodeDir__ variable in the code base and how replacers are used to make it so

@hyposcaler-bot
Copy link
Contributor

@hellt took at stab at this. please take a look at #2257 and feel free to redirect if it missed the mark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants