chef-partners/cisco-network-chef-cookbook

Name: cisco-network-chef-cookbook

Owner: Chef Partners

Description: null

Created: 2015-08-20 21:11:04.0

Updated: 2015-10-01 19:08:34.0

Pushed: 2015-12-21 20:21:04.0

Homepage: null

Size: 1381

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cisco-cookbook

Table of Contents
  1. Overview
  2. Cookbook Description
  3. Setup
  4. Usage
  5. Resource Reference
  6. Resource Catalog (by Technology)
  7. Resource Catalog (by Name)
  8. Limitations
  9. Development - Guide for contributing to the cookbook

Additional References

Overview

The cisco-cookbook allows a network administrator to manage Cisco Network Elements using Chef. This cookbook bundles a set of Chef Resources, providers, Sample Recipes and installation Tools for effective network management. The resources and capabilities provided by this cookbook will grow with contributions from Cisco, Chef Software Inc., and the open source community.

The Cisco Network Elements and Operating Systems managed by this cookbook are continuously expanding. Please refer to the Limitations section for details on currently supported hardware and software. The Limitations section also provides details on compatible Chef client and Chef Server versions.

This GitHub repository contains the latest version of the cisco-cookbook source code. Supported versions of the cisco-cookbook are available at Chef Supermarket. Please refer to SUPPORT.md for additional details.

Contributions to this cookbook are welcome. Guidelines on contributions to the cookbook are captured in CONTRIBUTING.md

Cookbook Description

This cookbook enables management of supported Cisco Network Elements using Chef. This cookbook enhances the Chef DSL by introducing new Chef Resources and Providers capable of managing network elements.

The set of supported network element platforms is continuously expanding. Please refer to the Limitations section for a list of currently supported platforms.

Setup
Chef Server

The cisco-cookbook is installed on the Chef server. Please see The Chef Server for information on Chef server setup. See Chef's knife cookbook site for general information on Chef cookbook installation.

Chef Client

The Chef Client (agent) requires installation and setup on each device. Agent setup can be performed as a manual process or it may be automated. For more information please see the README-agent-install.md document for detailed instructions on agent installation and configuration on Cisco Nexus devices.

Artifacts

As noted in the agent installation guide, these are the current RPM versions for use with cisco-cookbook:

Gems

The cisco-cookbook has dependencies on a few ruby gems. These gems are already installed in the cookbook as vendored gems so there are no additional steps required for installing these gems. The gems are shown here for reference only:

Usage

Place a dependency on cisco-cookbook in your cookbook's metadata.rb

nds 'cisco-cookbook', '~> 1.0'

See the recipes directory for example usage of cisco providers and resources.

Resource Reference
Resource Catalog (by Technology)
  1. Miscellaneous Types

  2. cisco_command_config

  3. Interface Types

  4. cisco_interface

  5. cisco_interface_ospf

  6. OSPF Types

  7. cisco_ospf

  8. cisco_ospf_vrf

  9. cisco_interface_ospf

  10. SNMP Types

  11. cisco_snmp_community

  12. cisco_snmp_group

  13. cisco_snmp_server

  14. cisco_snmp_user

  15. TACACS Types

  16. cisco_tacacs_server

  17. cisco_tacacs_server_host

  18. VLAN Types

  19. cisco_vlan

  20. cisco_vtp

Resource Catalog (by Name)

Resource Details

The following resources are listed alphabetically.

cisco_command_config

The cisco_command_config resource allows raw configurations to be managed by chef. It serves as a stopgap until specialized resources are created. It has the following limitations:

Examples
o_command_config 'loop42' do
mmand '
rface loopback42
scription Peering for AS 42
 address 192.168.1.42/24



o_command_config 'route42' do
mmand ' ip route 192.168.42.42/32 Null0 '

Parameters
cisco_interface

The cisco_interface resource is used to manage general configuration of all interface types, including ethernet, port-channel, loopback, and SVI (vlan).

Examples
o_interface 'Ethernet1/1' do
tion :create
v4_address '10.1.1.1'
v4_netmask_length 24
v4_proxy_arp true
v4_redirects true
utdown true
itchport_mode 'disabled'


o_interface 'Ethernet1/2' do
tion :create
cess_vlan 100
utdown false
itchport_mode 'access'
itchport_vtp true

Parameters

Note that the setting of the switchport_mode parameter influences which of the other parameters are permitted. Not all interface types support all of the below parameters.

Actions

Note that logical interfaces (loopback, SVI, etc.) can be created/destroyed, while physical interfaces (Ethernet, etc.) can only be configured/unconfigured. The same actions apply regardless.

cisco_interface_ospf

The cisco_interface_ospf resource is used to manage per-interface OSPF configuration properties. More broadly applicable OSPF configuration is managed by the cisco_ospf and cisco_ospf_vrf resources.

Examples
o_interface_ospf 'Ethernet1/2' do
tion :create
pf 'Sample'
ea 200
st 200
ad_interval 200
llo_interval 200
ssage_digest true
ssage_digest_encryption_type 'cisco_type_7'
ssage_digest_algorithm_type 'md5'
ssage_digest_key_id 7
ssage_digest_password '088199c89d4a5ee'
ssive_interface true

Parameters Actions
cisco_ospf

The cisco_ospf resource is used to enable/disable OSPF on the switch. More detailed OSPF configuration is managed by the cisco_ospf_vrf and cisco_interface_ospf resources.

Examples
o_ospf 'Sample' do
tion :create

Parameters Actions
cisco_ospf_vrf

The cisco_ospf_vrf resource is used to manage per-VRF OSPF configuration, including the default VRF.

Examples
o_ospf_vrf 'dark_blue default' do
to_cost 45000
fault_metric 5
g_adjacency 'detail'
mer_throttle_lsa_start 5
mer_throttle_lsa_hold  5500
mer_throttle_lsa_max   5600
mer_throttle_spf_start 250
mer_throttle_spf_hold  1500
mer_throttle_spf_max   5500


o_ospf_vrf 'dark_blue vrf1' do
to_cost 46000
fault_metric 10
g_adjacency 'log'
mer_throttle_lsa_start 8
mer_throttle_lsa_hold  5600
mer_throttle_lsa_max   5800
mer_throttle_spf_start 277
mer_throttle_spf_hold  1700
mer_throttle_spf_max   5700

Parameters Actions
cisco_package

The cisco_package resource is a subclass of the Chef yum_package resource. Unlike yum_package, it will always install packages into the NX-OS native environment, even if the Chef agent is running within guestshell.

Examples
book_file '/bootflash/demo-one-1.0-1.x86_64.rpm' do
ner 'root'
oup 'root'
de '0775'
urce 'rpm-store/demo-one-1.0-1.x86_64.rpm'


o_package 'demo-one' do
tion :install
urce '/bootflash/demo-one-1.0-1.x86_64.rpm'

Parameters

See https://docs.chef.io/resource_package.html

Actions

See https://docs.chef.io/resource_package.html

cisco_snmp_community

The cisco_snmp_community resource is used to manage SNMP communities.

Examples
o_snmp_community 'setcom' do
tion :create
l 'testcomacl'
oup 'network-admin'

Parameters Actions
cisco_snmp_group

The cisco_snmp_group resource is used to manage SNMP groups. Cisco NX-OS defines SNMP groups based on user roles, so this resource is unable to create or delete groups but can only be used to validate that the group exists or not.

Examples
o_snmp_group 'network-admin' do
tion :create

Parameters Actions
cisco_snmp_server

The cisco_snmp_server resource is used to manage the SNMP server configuration on a node. There can only be one instance of this resource per node.

Examples
o_snmp_server 'default' do
aaa_user_cache_timeout 1000
contact 'user1'
global_enforce_priv true
location 'rtp'
packet_size 2500
protocol false
tcp_session_auth false

Parameters Actions
cisco_snmp_user

The cisco_snmp_user resource is used to manage SNMP user configuration.

Examples
o_snmp_user 'v3test' do
oups ['network-admin']


o_snmp_user 'withengine 128:128:127:127:124:2' do
th_password 'Plus+Minus-'
th_protocol 'md5'
oups ['network-admin']
calized_key false
iv_password 'Minus-Plus+'
iv_protocol 'des'

Parameters Actions
cisco_tacacs_server

The cisco_tacacs_server resource is used to manage global TACACS+ server configuration. There can only be one instance of this resource per node.

Examples
o_tacacs_server 'default' do
tion :create
adtime 20
rected_request true
cryption_password 'test123'
cryption_type 'clear'
urce_interface 'Ethernet1/2'
meout 10

Parameters Actions
cisco_tacacs_server_host

The cisco_tacacs_server_host resource is used to manage per-host TACACS+ configuration.

Examples
o_tacacs_server_host 'testhost' do
tion :create
cryption_password 'foobarpassword'
cryption_type 'clear'
rt 66
meout 33

Parameters Actions
cisco_vlan

The cisco_vlan resource is used to manage VLAN configuration.

Examples
o_vlan '220' do
tion :create
utdown true
ate 'active'
an_name 'newtest'

Parameters Actions
cisco_vtp

The cisco_vtp resource is used to manage VLAN Trunking Protocol (VTP) configuration. There can only be one instance of this resource per node.

Examples
o_vtp 'default' do
tion :create
main 'cisco1234'
lename 'bootflash:/vlan.dat'
ssword 'test1234'
rsion 2

Parameters Actions
Limitations

Minimum Requirements:

Development

Contributions to cisco-cookbook are welcome and encouraged. Please follow this general workflow for new contributions. See CONTRIBUTING.md for more information.

  1. Fork the cisco-cookbook repository on GitHub
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using GitHub

right (c) 2014-2015 Cisco and/or its affiliates.

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.