Version information
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
Add this module to your Puppetfile:
mod 'benjaminrobertson-juniper_config', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
juniper_config
A bolt task which allows you to update Juniper devices with configurations snippets.
Table of Contents
- Description
- Setup - The basics of getting started with juniper_config
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- 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
- Requires bolt to be installed see: https://puppet.com/docs/bolt/latest/bolt_installing.html#install-bolt-on-rhel-sles-or-fedora
- Use bolt to install module 'bolt project init --modules benjaminrobertson-juniper_config' Note: it will install in the current directory you're working in.
- 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
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
Changelog
All notable changes to this project will be documented in this file.
Release 1.0.0
Features
- Uplifted config_apply task to use TCL (expect) only.
Bugfixes
- #10 When --noop is used and configuration is invalid. Bolt still report the node as successful
- #12 Temporary config file not deleted if config is locked.
Release 0.1.2
Features
- Include new sleeptime option, allow user to specify how long to wait for JunOS to apply configurations
Bugfixes
- #7 If commit check fails, bolt still reports as successful
- #8 If commit check fails, temporary config file isn't deleted.
- #9 Task is not aware if configuration database is locked
Known Issues
- #10 When --noop is used and configuration is invalid. Bolt still report the node as successful
Release 0.1.1
Features
Bugfixes
- Documentation update for Puppet forge
Known Issues
Release 0.1.0
Features
Bugfixes
Known Issues