No commit activity in last 3 years
No release in over 3 years
Provision Junos OS boxes using CLI commands.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16.a
~> 13.0
 Project Readme

Vagrant::JunosCli

Features

  • Provision Junos OS boxes using CLI commands

Usage

Install using standard Vagrant plugin installation methods.

$ vagrant plugin install vagrant-junos_cli

Quick Start

After installing the plugin you need to obtain a Junos box image. Official boxes are available here.

$ vagrant box add juniper/vqfx10k-re

Create a Vagrantfile based on one of the examples.

Vagrant.configure('2') do |config|
  config.ssh.insert_key = false

  config.vm.define 'vqfx' do |vqfx|
    vqfx.vm.hostname = 'vqfx'
    vqfx.vm.box = 'juniper/vqfx10k-re'
    vqfx.vm.synced_folder '.', '/vagrant', disabled: true

    # Management port (em1 / em2)
    vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', virtualbox__intnet: 'reserved-bridge'
    vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', intnet: 'reserved-bridge'

    # (em3  em4)
    (1..2).each do |seg_id|
      vqfx.vm.network 'private_network', auto_config: false, nic_type: '82540EM', intnet: 'segment'
    end

    config.vm.provision 'junos_cli', path: 'provision.cmd'
  end
end

Note the provision.cmd file, referenced in the provisioner. This is where your CLI commands should go.

configure private
set interfaces em3 unit 0 family inet address 10.0.0.1/24
commit
exit

Run vagrant up and the new box is getting created with the address configured.

Configuration

Junos CLI provisioner accepts most options available for the Shell provisioner. Do not pass args or env.

Extra options

  • skip_cleanup (boolean) - Do not clean up script uploaded to upload_path after execution.
  • skip_prepare (boolean) - Do not try to fix print and export commands in the box. Provisioning output might get omitted.