Skip to content

ZosTeroPs is a ZTP (Zero Touch Provisioning) server that aims to support provisioning of devices on different platforms from different vendors.

License

Notifications You must be signed in to change notification settings

amigne/ZosTeroPs

Repository files navigation

ZosTeroPs

Zosterops is a genus of passerine birds containing the typical white-eyes in the white-eye family Zosteropidae. (Source: Wikipedia)

But ZosTeroPs is a ZTP (Zero Touch Provisioning) server that aims to support provisioning of devices on different platforms from different vendors.

It's a current WIP (Work In Progress) project, but it's expected to be fully operational and to include more and more advanced features as the development progresses. I have adopted an incremental development approach: It is expected to have a minimal working platform in the early development stage, with the addition of more advanced and customizing features over the time.

ZosTeroPs is a web system developed in Python using the Django framework.

Installation

Installation is described in INSTALL.md

Guided tour

Vendors and Platforms

ZosTeroPs permits to create vendors and platforms that are used to classify firmwares.

Vendors' list List of vendors page

Platforms' list List of platforms page

Firmwares

ZosTeroPs hosts firmwares and delivers them by HTTP upon device request. When files are downloaded, SHA512 and MD5 checksums are calculated. This permits to ensure the image is not alterated. This also serves as a local registry of checksums to ensure the image has correctly been transferred to the network device, if it permits to make such verifications.

Firmwares' list List of available firmwares

Firmware's detail Details of a specific firmware

Firmware's edit Edition of a firmware

Configurations

Configurations are template-based text files that are rendered with device-specific content such hostnames, IP addresses, firmwares, ...

Configurations is well suited for providing configuration files or data structures (for instance JSON or YAML content). Specific data are determined using one or multiple parameters added to the request URL. These parameters are compared with the key values of configuration tables.

Configurations' list List of defined configurations

Config's detail Example of one templated-Cisco configuration. The specific values are determined upon the MAC (the first column of the table is the key) address of the device that has to be passed (mandatory parameter) at the end of the URL (using the ?MAC=0011.2233.4455 syntax).

Config's edit Creation/edition of a configuration is easy.

Config's download When correctly requested, the configuration is rendered using the substitution data (here for the MAC 0011.2233.4455)

Configuration is also suitable to deliver configuration data, for instance, a JSON file: Data's detail Example of one templated-JSON data file. Note that this configuration uses preprocessor elements, such as @@FIRMWARE[2].URL@@. This is typically well suited to pass values such as an firmware URL download link, or a checksum value.

Data's detail Creation/edition of a data template is easy.

Data's download Example of a downloaded JSON data file for the MAC 0011.2233.4455

ZTP Scripts

ZTP scripts are usually the scripts that are loaded by the device during the initial configuration process. They are generally more general than configuration as the URL to retrieve them is most of the time specified in DHCP responses.

ZosTeroPs permits to define a script template in any textual form that is supported by the network device. ZosTeroPs permits to substitute some parameters with different custom values. These are simple substitutions that make it easy to set/change values. These parameters can be referenced in the template using double curly braces. If the parameter DEBUG is set to True, the syntax {{ DEBUG }} in the template would be replaced with True.

The parameter-value substitution has to be enabled by checking the "Render template" value and "Use parameters".

Substitution values may also be given using the URL query string (the part that comes after the page name followed by a question mark). This needs to be enabled with "Accept query string".

When both "Use parameters" and "Accept query string" are checked, parameters can overwrite query string values if both define the same name. Checking "Priority query string over arguments" makes query string values overwrite parameters when both have the same name.

In addition to parameter substitution, ZTP scripts also allows preprocessing. Preprocessing occurs in any case (independently of the checkbox values) and before parameter substitution. Both parameters and template can have preprocessor values.

ZTP scripts' list List of defined ZTP scripts

ZTP scripts' list Details of one ZTP script

ZTP scripts' list Edition of one ZTP script

Preprocessor

The preprocessor substitutes the preprocessing elements with some values determined by the system. Preprocessing elements are surrounded with double at-signs, like @@ HTTP_SERVER @@. The substitution can be performed on any parameter or any template of the ZTP script or Configuration sections.

Supported preprocessing elements are:

  • CONFIG[id] returns the name of the configuration with index id
  • CONFIG[id].URL returns the URL of the configuration with index id
  • CONFIG_PATH which returns the path after the root URL used to access the Configurations. This is equals to the ZTP_CONFIG_URL setting.
  • FIRMWARE[id] returns the file name for the firmware with index id
  • FIRMWARE[id].URL returns the URL for the firmware with index id
  • FIRMWARE[id].SIZE returns the file size of the firmware with index id
  • FIRMWARE[id].SHA512 returns the SHA512 checksum of the firmware with index id
  • FIRMWARE[id].MD5 returns the MD5 checksum of the firmware with index id
  • FIRMWARE_PATH which returns the path after the root URL used to access the firmwares. This is equals to the ZTP_FIRMWARES_URL setting.
  • HTTP_SERVER which returns the root URL in the form protocol://server_name/ of the current request.
  • PORT which returns the TCP port of the ZosTeroPs server
  • PROTOCOL which returns 'http' or 'https' depending of the protocol used for the current request
  • SERVER_NAME which returns the server name (or IP address) of the ZosTeroPs server (when the server responds to multiple addresses, the name returned is the one answering the query).
  • ZTP[id] returns the name of the ZTP script with index id
  • ZTP[id].URL returns the URL of the ZTP script with index id
  • ZTP_PATH which returns the path after the root URL used to access the ZTP scripts. This is equals to the ZTP_BOOTSTRAP_URL setting.

Note: Unknown or syntactically incorrect preprocessing elements are ignored and left as is (understand they are not substituted).

Languages

Currently, ZosTeroPs supports English and French. Language is determined based on the user browser-settings.

History

History of releases is detailed in HISTORY.md

Credits

And now, give back to Caesar what belongs to Caesar: The idea of developing ZosTeroPs is consecutive to the discover of the Tim Dorssers' ZTP project. This may explain some resemblance of the GUI or some code reuse. Tim's work as well as ZosTeroPs are both under MIT license.

ZosTeroPs includes all or some part of code from the following projects:

  • Tim Dorssers' ZTP: Copyright (c) 2019 Tim Dorssers
  • django-auditlog: Copyright (c) 2013-2020 Jan-Jelle Kester
  • jQuery: Copyright OpenJS Foundation and other contributors, https://openjsf.org/
  • jsTable: Which is a fork of Jexcel, removing unused code in order to make it lighter and without confusing features (such as formulas, ...)
  • jQuery Formset: Copyright (c) 2009, Stanislaus Madueke
  • stayhomech: Copyright (c) 2020 Alexandre Georges for the support with multiple settings file

About

ZosTeroPs is a ZTP (Zero Touch Provisioning) server that aims to support provisioning of devices on different platforms from different vendors.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published