@@ -234,13 +234,13 @@ def main(args):
234234 """
235235 BASE_TERMINATTR = """
236236daemon TerminAttr
237- exec /usr/bin/TerminAttr -cvaddr={0}:9910 -taillogs -cvcompression=gzip -cvauth=key, {1} -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent
237+ exec /usr/bin/TerminAttr -cvaddr={0} -taillogs -cvcompression=gzip -cvauth={1} -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent
238238 no shutdown
239239!
240240 """
241241 BASE_TERMINATTR_VRF = """
242242daemon TerminAttr
243- exec /usr/bin/TerminAttr -cvaddr={0}:9910 -cvvrf={2} -taillogs -cvcompression=gzip -cvauth=key, {1} -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent
243+ exec /usr/bin/TerminAttr -cvaddr={0} -cvvrf={2} -taillogs -cvcompression=gzip -cvauth={1} -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent
244244 no shutdown
245245!
246246 """
@@ -333,6 +333,16 @@ def main(args):
333333 pS ("INFO" , "Leveraging default dataplane" )
334334 except :
335335 pS ("INFO" , "Leveraging default dataplane" )
336+ # Check for new CV section
337+ if 'cv' in topo_yaml :
338+ try :
339+ cv_nodes = f":{ topo_yaml ['cv' ]['port' ]} ," .join (topo_yaml ['cv' ]['nodes' ])
340+ cv_nodes = f"{ cv_nodes } :{ topo_yaml ['cv' ]['port' ]} "
341+ cv_auth = f"token,{ topo_yaml ['cv' ]['auth' ]['path' ]} /token"
342+ cv_token = topo_yaml ['cv' ]['auth' ]['cert' ]
343+ except :
344+ pS ("INFO" , "New CV schema not formatted correctly" )
345+ cv_nodes = False
336346
337347 # Load and Gather network Link information
338348 pS ("INFO" , "Gathering patch cable lengths and quantities..." )
@@ -468,11 +478,22 @@ def main(args):
468478 _tmp_startup .append (BASE_MGMT_VRF .format (CEOS [_node ].ip , topo_yaml ['infra' ]['gateway' ], mgmt_vrf ))
469479 else :
470480 _tmp_startup .append (BASE_MGMT .format (CEOS [_node ].ip , topo_yaml ['infra' ]['gateway' ]))
471- if 'cvpaddress' and 'cvp-key' in topo_yaml ['topology' ]:
481+ # Perform eval based on CV schema
482+ if cv_nodes :
472483 if mgmt_vrf != "default" :
473- _tmp_startup .append (BASE_TERMINATTR_VRF .format (topo_yaml [ 'topology' ][ 'cvpaddress' ], topo_yaml [ 'topology' ][ 'cvp-key' ] , mgmt_vrf ))
484+ _tmp_startup .append (BASE_TERMINATTR_VRF .format (cv_nodes , cv_auth , mgmt_vrf ))
474485 else :
475- _tmp_startup .append (BASE_TERMINATTR .format (topo_yaml ['topology' ]['cvpaddress' ], topo_yaml ['topology' ]['cvp-key' ]))
486+ _tmp_startup .append (BASE_TERMINATTR .format (cv_nodes , cv_auth ))
487+ # Copy CV Cert info to startup config
488+ create_output .append ('echo "{0}" > {1}/{2}/{3}/token\n ' .format (cv_token , CONFIGS , _tag , _node ))
489+ else :
490+ if 'cvpaddress' and 'cvp-key' in topo_yaml ['topology' ]:
491+ if mgmt_vrf != "default" :
492+ _cv_node = f"{ topo_yaml ['topology' ]['cvpaddress' ]} :9910"
493+ _cv_auth = f"key,{ topo_yaml ['topology' ]['cvp-key' ]} "
494+ _tmp_startup .append (BASE_TERMINATTR_VRF .format (_cv_node , _cv_auth , mgmt_vrf ))
495+ else :
496+ _tmp_startup .append (BASE_TERMINATTR .format (_cv_node , _cv_auth ))
476497 create_output .append ('echo "{0}" > {1}/{2}/{3}/startup-config\n ' .format ('' .join (_tmp_startup ), CONFIGS , _tag , _node ))
477498 # Creating anchor containers
478499
0 commit comments