Quantcast
Channel: THWACK: Popular Discussions - Network Configuration Manager
Viewing all articles
Browse latest Browse all 4266

Ok, so maybe this is a dumb question....

$
0
0

Quite frankly, I suck at writing these config change thingies.... But they're really useful if I can get them to work. I need to add the layer 2 configuration for more than one vlan on all of my Nexus 5Ks. It's a huge fabricpath & I really don't want to go to each switch to do this. I could just run a script, I know, but it would be awesome if I could just use variables instead of having to re-write the script. I know I have a template for adding a single L2 vlan:

 

.CHANGE_TEMPLATE_DESCRIPTION

        This template creates a new L2 vlan

.CHANGE_TEMPLATE_TAGS

Cisco, interface, VLAN, description, properties

.PLATFORM_DESCRIPTION

        Cisco IOS

 

.PARAMETER_LABEL @ContextNode

        NCM Node

.PARAMETER_DESCRIPTION @ContextNode

        The node the template will operate on.  All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.

 

.PARAMETER_LABEL @NewVlanID

        Vlan ID

.PARAMETER_DESCRIPTION @NewVlanID

        Create new vlan ID

 

.PARAMETER_LABEL @VlanDescription

        Vlan Name

.PARAMETER_DESCRIPTION @VlanDescription

        Enter the name of the new vlan

       

*/

script CreateNewVlan (

                                            NCM.Nodes @ContextNode,

                                            string @NewVlanID,

                                            string @VlanDescription

                                                                          )

{

    // Enter configuration mode

    CLI

    {

       configure terminal

    }

        // Create vlan

        CLI

        {

           vlan @NewVlanID

           name @VlanDescription

           mode fabricpath

           end

                 

        }

    

                                                      

So my question is how do I get that to work for multiple vlans? I'm guessing it's going to be some kind of for loop but I have no idea how to get that to work....


Viewing all articles
Browse latest Browse all 4266

Trending Articles