Posted on July 16, 2020 9:13 pm
 |  Asked by Jonathan Gardner
 |  58 views
0
0
Print Friendly, PDF & Email

Is there a way to control the name of configlets generated by configlet builders?

Example:

Name of Configlet Builder: “configlet-builder-xyz”

When configlets are generated by this they are automatically named : “configlet-builder-xyz_IP-ADDRESS-OF-SWITCH_1

I would like to be able to dictate the name of the generated configlets, ideally with variables contained in the configlet builder itself.

I do see that it seems possible to rename them after they are generated, however I would like to avoid that manual step if possible.

0
Posted by Tyler Conrad
Answered on July 16, 2020 9:55 pm

Hey Jonathan,

There's not a way that I'm aware of to directly control the configlet name generated by the builder on the front-end, but I wrote a script a while ago that may be useful to do it for you automatically using a cron job.

https://github.com/brokenpackets/configlet_AutoRename/blob/master/autoRename.py

The logic of the script is that it looks through your generated configlets for the line:
`!DynConfig somestringhere`

if this line exists, it renames the configlet to use somestringhere as the name.

Hope this helps,
-T

Post your Answer

You must be logged in to post an answer.