Forge Home

netdev_stdlib_junos

Junos Provider code for Networking Device (netdev stdlib) Library

18,502 downloads

4,901 latest version

3.3 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 2.0.6 (latest)
  • 2.0.4
  • 2.0.3
  • 2.0.2
  • 2.0.1 (deleted)
  • 2.0.1-beta
  • 2.0.0
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Feb 28th 2019

Start using this module

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

Add this module to your Puppetfile:

mod 'juniper-netdev_stdlib_junos', '2.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add juniper-netdev_stdlib_junos
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install juniper-netdev_stdlib_junos --version 2.0.6

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

juniper/netdev_stdlib_junos — version 2.0.6 Feb 28th 2019

OVERVIEW

Netdev is a vendor-neutral network abstraction framework developed by Juniper Networks and contributed freely to the DevOps community

This module contains the Junos specific Provider code implementing the Resource Types defined in netdevops/netdev_stdlib

EXAMPLE USAGE

This module has been tested against Puppet agent 2.7.19 and 3.6.1. Here is a short example of a static manifest for a Junos EX switch. This example assumes that you've also installed the Puppet stdlib module as this example uses the keys function.

node "myswitch1234.mycorp.com" {
     
  netdev_device { $hostname: }
    
  $vlans = {
    'Blue'    => { vlan_id => 100, description => "This is a Blue vlan" },
    'Green'   => { vlan_id => 101, description => "This is a Green vLAN" },
    'Purple'  => { vlan_id => 102, description => "This is a Puple vlan" },
    'Red'     => { vlan_id => 103, description => "This is a Red vlan" },
    'Yellow'  => { vlan_id => 104, description => "This is a Yellow vlan" }   
  }
    
  create_resources( netdev_vlan, $vlans )
    
  $access_ports = [
    'ge-0/0/0',
    'ge-0/0/1',
    'ge-0/0/2'
  ]
    
  $uplink_ports = [
    'xe-0/0/0',
    'xe-0/0/2'
  ]
      
  netdev_l2_interface { $access_ports:
    untagged_vlan => Blue
  }
          
  netdev_l2_interface { $uplink_ports:
    tagged_vlans => keys( $vlans )
  }

  # service variables passed in template file
  $services = [ [ 'ftp' ], [ 'ssh' ], [ 'telnet' ], [ 'netconf', 'ssh' ] ]

  netdev_stdlib_junos::apply_group{ "services_group":
    template_path => "netdev_stdlib_junos/services.set.erb",
    active        => true,
    ensure        => present,
  }
  
  # Syslog variable passed in 'syslog.text.erb' template file
  $syslog_names = {
  'messages' =>             [ { 'facility' => 'any', 'level' => 'critical' }, { 'facility' => 'authorization', 'level' => 'info' } ] ,
  'interactive-commands' => [ { 'facility' => 'interactive-commands', 'level' => 'error'} ]
  }

  netdev_stdlib_junos::apply_group{ "syslog_group":
    template_path => "netdev_stdlib_junos/syslog.text.erb",
    active        => true,
    ensure        => present,
  }
  
  # Event-policy variable passed in 'event-options.xml.erb' template file
  $policy = {
            'p1' => {
                        'events'       => [ 'TEST' ],
                        'action'       => 'then',
                        'event-script' => 'hello.slax'
                    }
          }
  $event_script = [ 'hello.slax' ]

  # file resource copies the file hello.slax from master to agent
  file { '/var/db/scripts/event/hello.slax':
    mode => 0644,
    source => "puppet:///modules/netdev_stdlib_junos/junoscripts/event/hello.slax",
  }
  
  # Configure event policy and event script
  netdev_stdlib_junos::apply_group{ "event_options_group":
    template_path => "netdev_stdlib_junos/event-options.xml.erb",
    active        => true,
    ensure        => present,
  }  
}

DEPENDENCIES

  • Puppet >= 2.7.19
  • Ruby Gem netconf 0.2.5
  • Puppet module netdevops/netdev_stdlib version >= 1.0.0
  • Junos OS release and jpuppet image by platform:
    • QFX3500, QFX3600:
      • JUNOS 12.3X50-D20.1
      • jpuppet-qfx-1.0R1.1
    • EX4200, EX4500, EX4550:
      • JUNOS 12.3R2.5
      • jpuppet-ex-1.0R1.1
    • MX240, MX480, MX960:
      • JUNOS 12.3R2.5
      • jpuppet-mx-1.0R1.1
    • MX5, MX10, MX40, MX80:
      • JUNOS 12.3R2.5
      • jpuppet-mx80-1.0R1.1
    • QFX5100:
      • JUNOS >= 14.2
      • jpuppet-3.6.1_1.junos.i386.tgz
    • EX4300
      • JUNOS >= 14.2
      • jpuppet-3.6.1_1.junos.powerpc.tgz

INSTALLATION ON PUPPET-MASTER

  • gem install netconf
  • puppet module install juniper/netdev_stdlib_junos

RESOURCE TYPES

See RESOURCE-STDLIB.md for documentation and usage examples

CONTRIBUTORS

Juniper Networks is actively contributing to and maintaining this repo. Please contact jnpr-community-netdev@juniper.net for any queries.

Contributors:

Ganesh Nalawade, Priyal Jain

Former Contributors:

Jeremy Schulman

LICENSES

See LICENSE