Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[precheck] Section

If you include a precheck section at the top of the config file this will run some tests before continuing to do the ZTP.

...

This indicates the action to take based on a fail in the precheck. If the precheck passes then the ZTP will continue as normal but if it fails it must take one of two actions. EXIT_SUCCESS will send a message to RuBAN to say that this profile is not necessary for this device and therefore this device will not try to run this ZTP profile again. The other option "EXIT" simply exits out of ZTP but does not report anything up to RuBAN. The result of this is that when the ZTP process next runs it will try the same profile again.

 


So to recap the example above would be useful where you wish to upgrade the Ios version on your deployment of devices but you don't want it to run if the device is already on that version of Ios. This could also be adapted to for example not run the ZTP until IP connectivity to a certain server has come up and keep retrying until then. 

[config] Section

Each line in the config section represents a line of config to be applied to the device.

...

This allows different variables based on different serial numbers.

Config Dialogue command

Some configuration commands trigger a dialogue on the CLI when they are executed.

...

So when dealing with an operation that requires a dialogue to complete it must be structured as above for it to work.

[post-reboot] Section

The existence of this flag indicates that a reboot is needed to complete the provisioning. Many ZTP actions require a reboot to complete.

For example upgrading the Ios or copying a new running config into the startup config. This flag allows the ZTP process to pause save its status and it will resume after the device has come back up from where it left off.

[verify] Section

The verify section is where you perform config verification commands. they must be copied into the config file underneath the [verify] tag which comes after the configuration section.

...

The other option is "ROLLBACK" which indicates that a rollback is necessary, this will execute any commands contained within the [rollback] section.

Show command output

After the config has been run you can run any command you wish on the CLI and parse the output to verify that a certain pattern is or is not contained in the output.

...

E.G: CMD~sh int <ifname>~exclude~Description: ZTP changed this!

IP connectivity

Another common check when applying a change to a config is to ensure the IP connectivity is as is expected.

...

So if the value in the CSV for ip_sub is for example 10.3.3.3 then the verification check will ensure that IP cannot be reached.

[rollback] Section

This section just contains a number of configuration commands to be executed sequentially much like the commands in the [config] section.

...

This would undo setting of the boot image.

Example contents

Below is an example of the full contents of a config file. You would save these contents into a .txt file which you would upload  through the RuBAN web user interface while creating a ZTP profile.

[config]
int <ifname>
desc ZTP changed this!!!!
exit
username <username> privilege 15 password <password>
no ev m applet ZTP_BOOTSTRAP

[verify]
CMD~sh int <ifname>~include~Description: ZTP changed this!!!!
CMD~sh run~include~username <username>
CMD~sh ev m p r~exclude~ZTP_BOOTSTRAP

 

 

 

 

...