Giter Site home page Giter Site logo

config-loader's Introduction

#Config-Loader

A simple SLAX script that allows for easily loading a config onto a a Junos device

Loading the script

  1. Place the script file "config-loader.slax" into the directory /var/db/scripts/op/ on the device
  2. Enable the script for usage in the configuration ..1 set system scripts op file config-loader.slax
  3. Commit the configuration ..1 If there is an error in the script or if the script is missing then Junos will throw an error

Usage

The tool can remotely load a configuration file via a file, FTP, or HTTP URL.

The script requires three arguments to load the configuration

  1. source: The URL source for the config
  1. action: The action to take with the config
  • replace: Replaces the existing configuration with the newly loaded configuration file
  • merge: Merges the newly loaded configuration with the existing config
  • override: Discards all other candidate configurations and replaces it with the loaded config (not needed for this use case)
  • set: Set is specified when the text file you are loaded uses configuration CLI commands
  1. format: The format of the loaded configuration
  • xml: Specifies the loaded file is XML
  • text: Specifies the file is loaded as a text config
    • This supports the junos formatted file or a series of CLI set/delete commands
    • If the loaded file is a series of set/delete commands the action MUST be set to "set"

Examples

Successfully loaded config:

root@device> op config-loader action set format text source http://172.16.237.1:8080/testconfig.set
Opening candidate configuration
Loading new configuration
Commiting candidate configuration

Error fetching config:
rroot@device> op config-loader action set format text source http://172.16.237.1:8080/testconfig.bad                      
Opening candidate configuration
Loading new configuration
Error fetching config

fetch: http://172.16.237.1:*: Not Found

Testing

Included in the repository under the tests/ folder is a series of test cases that can be used to test the tool

config-loader's People

Contributors

robwc avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.