Forge Home

juniper_config

Task which applies configurations to JunOS devices

2,383 downloads

812 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.0 (latest)
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Nov 23rd 2021
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.10 < 8.0.0
  • , , , ,
Tasks:
  • config_apply

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'benjaminrobertson-juniper_config', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add benjaminrobertson-juniper_config
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install benjaminrobertson-juniper_config --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

benjaminrobertson/juniper_config — version 1.0.0 Nov 23rd 2021

juniper_config

A bolt task which allows you to update Juniper devices with configurations snippets.

Table of Contents

  1. Description
  2. Setup - The basics of getting started with juniper_config
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

A bolt task which allows you to update Juniper devices with configurations snippets.

Setup

Setup Requirements

Tested on the following platforms Enterprise linux: 7, 8 Ubuntu: 18.04, 20.04 SLES: 12, 15

Requires expect and bolt

  1. Requires bolt to be installed see: https://puppet.com/docs/bolt/latest/bolt_installing.html#install-bolt-on-rhel-sles-or-fedora
  2. Use bolt to install module 'bolt project init --modules benjaminrobertson-juniper_config' Note: it will install in the current directory you're working in.
  3. In the same directory run 'bolt task show', you should see "juniper_config::config_apply Check and compare Junper config differences" listed

Note: unless the task is installed in your bolt module path, you will need to run bolt task from the juniper_config project directory

Beginning with juniper_config

Note: --transport=remote must always be set when using this task as this script is executed locally.

A basic config apply test

bolt task run juniper_config::config_apply --targets hostname --transport=remote config=/path/to/config user=bolt apply_mode=merge --noop

Usage

-- User with password to merge a configuration file --

bolt task run juniper_config::config_apply --targets hostname --transport=remote config=/path/to/config user=bolt password=hello apply_mode=merge

-- Applying to multiple devices in set mode --

bolt task run juniper_config::config_apply --targets hostname,hostname2,hostname3 --transport=remote config=/path/to/config user=bolt password=hello apply_mode=set

-- Applying to device with specified ssh key --

bolt task run juniper_config::config_apply --targets hostname,hostname2,hostname3 --transport=remote config=/path/to/config user=bolt ssh_key=/path/to/ssh/key apply_mode=set

Reference

Parameters accepted

  • config : String Minlength 1
  • user : String Minlength 1
  • apply_mode : String["set,"merge","override","replace"]
  • password : Optional String
  • ssh_key : Optional String
  • sleeptime : Optional Integer - sleep time between operations on the JunOS device, default 5 seconds. Some devices with large configurations sets may require longer to apply.

For apply_mode see https://www.juniper.net/documentation/en_US/junos/topics/topic-map/junos-config-files-loading.html

If no password or ssh_key is set, standard user ssh key will be used.

Supports noop, will report on changes to be made if --noop is used.

Limitations

Tested on the following platforms Enterprise linux: 7, 8 Ubuntu: 18.04, 20.04 SLES: 12, 15

Tested on the following Juniper hardware

  • vSRX - JUNOS 20.4R3.8
  • vMX - JUNOS 19.4R1.9