Juniper/netdev

Name: netdev

Owner: Juniper Networks

Description: Development repository for Opscode Cookbook netdev

Forked from: chef-partners/netdev

Created: 2015-07-10 05:51:09.0

Updated: 2016-01-13 14:26:49.0

Pushed: 2016-04-14 04:33:46.0

Homepage: null

Size: 175

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

netdev Cookbook

Build Status Cookbook Version

Provides a set of vendor-agnostic resources for managing networking devices.

Requirements
Usage

Add a dependency on netdev to your cookbook's metadata.rb

nds 'netdev'
Resources/Providers

All resources are fully documented on Chef's offical documentation site.

Resource | Description | Example Usage | ——-|————-|———| netdev_interface | This resource provides an abstraction for managing physical interfaces on network elements. | netdev_interface integation test fixture netdev_l2_interface | This resource provides an abstraction for creating and deleting layer 2 interfaces on network devices. | netdev_l2_interface integation test fixture. netdev_lag | This resource provides an abstraction for creating and deleting link aggregation group interfaces. | netdev_lag integation test fixture. netdev_vlan | This resource provides an abstraction for creating and deleting VLANs. | netdev_vlan integation test fixture. netdev_group | This resource provides an abstraction for creating and deleting JUNOS Groups. | netdev_group integation test fixture.

Testing

You can run the tests in this cookbook using Rake:

 integration  # Run Test Kitchen integration tests
 style        # Run all style checks
 style:chef   # Lint Chef cookbooks
 style:ruby   # Run Ruby style checks
 travis:ci    # Run tests on Travis
Test Kitchen

Test Kitchen 1.0.0+ ships with a proxy driver that proxies commands through to a test instance whose lifecycle is not managed by Test Kitchen. This driver is useful for testing against long-lived non-ephemeral test instances that are simply “reset” between test runs. This driver is also perfect for testing against physical network equipment!

You will need to specify the location and login details for the switch you will be running Test Kitchen against. This should be done in a .kitchen.local.yml file:

forms:
me: junos-13.2
iver:
# Set the login user of the test switch
username: schisamo
# Set the ipaddress or DNS name of the test switch.
host: 10.66.44.10
# Set the port sshd is listening on; defaults to 22.
port: 22

This repository ships with an example file which can easily be copied into place:

itchen.local.example.yml kitchen.local.yml
Juniper Equipment

Requirements:

Test run resets on Juniper device is achieved using Juno's rescue configuration feature. A rescue configuration allows you to define a known working configuration or a configuration with a known state that you can roll back to at any time.

Creating a rescue configuration is easy. SSH into your switch and run the following command:

ter:0}
samo@junos-chef-dev> request system configuration rescue save

ter:0}
samo@junos-chef-dev>

You now have a known good state to roll back to! Test Kitchen activates the rescue configuration by issuing the command cli -c 'configure; rollback rescue; commit' during the CREATE and DESTROY stages of testing. Reference the .kitchen.yml for some additional environment variables that are used to set host, username and sshd port of the switch being tested against.

Arista Equipment

Currently not supported.

License & Authors
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.