Skip to content

Tool for loading templated configuration to JunOS devices.

License

Notifications You must be signed in to change notification settings

xunil/loadconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

I needed a tool to call from a shell script which could generate new configuration statements for Juniper devices, based on existing config, and load the new configuration to the devices automatically. This tool fits the bill; uses net/ssh, REXML, Erubis, and my own cobbled-together object for interacting with JunOScript.

Pass it SSH credentials, a hostname, and an Erubis template. The REXML::Document object current_config is available from within the template; perform XPath searches (or walk the document) to access the existing configuration. This makes it much easier to build config changes.

Usage: loadconfig [options]
    -u, --username=USERNAME          Juniper username
    -p, --password=PASSWORD          Juniper password
    -k, --ssh-key=KEYFILE            Juniper SSH key filename
    -H, --hostname=HOSTNAME          Hostname of Juniper device
    -f, --filename=FILENAME          Filename of configuration snippet to load
    -n, --dryrun                     Verify configuration commit would succeed but do not commit
    -d, --debug                      Output JunOScript interactions
    -h, --help                       Display usage message

References

Juniper publishes some great material on JunOScript automation, which is invaluable in learning how to use this tool.

License

Released under the MIT license. See the file LICENSE.

About

Tool for loading templated configuration to JunOS devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages