CLI config generator for any CLI configurable devices
1. Introduction

This perl script reads-in a Template- and parameterdata-File and generates multiple Config-Files by replacing the placeholders <parameterx> with the corresponding value on the parameter file. The config files will be named after the first parameter in the data-file, so typically you should put the hostname as the first columns, then files will be named hostnamex.cli

Program arguments:
-h: just displays this help file
-t: template file with placeholder like <parameterx>
-p: parameter file with a comma or semicolon as separator, not a tab!

The first line must contain the names of the parameters
e.g. parameterx (this name is then used as placeholder)
perl -p data.csv -t template.cli

The format of the data file (as an example) is as follows (separated by semicolons! Can be exported from excel!):


The first row carries the parameternames, these names are then used as placeholders (surrounded by brackets: <param1>) in the template file:

! System Identity Configuration
ip address <MgmtIP>
hostname <Hostname>
! System Lan Interface Configurations
! Interface on 0/1
interface FastEthernet 0/1
ip address <PrivateIP>
! Interface on 1/1
interface FastEthernet 1/1
ip address <PublicIP>
logging "" facility LOCAL0 level NORMAL port 514
! Routing Static Route Configuration
router static
! ip default-network <PublicGW> public 10 enable
ip route <PublicGW> 1 enable
! Routing OSPF Configuration
router ospf
router-id <MgmtIP>

There are no limits on the number of parameters or length of files.