Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

cumulus-switch (1) Versions 2.1.2

Configures a Cumulus switch via attributes

Berkshelf/Librarian
Policyfile
Knife
cookbook 'cumulus-switch', '~> 2.1.2'
cookbook 'cumulus-switch', '~> 2.1.2', :supermarket
knife cookbook site install cumulus-switch
knife cookbook site download cumulus-switch
README
Dependencies
Changelog
Quality

Description

This cookbook provides an interface via attributes to the official Cumulus cookbook's providers, and then some.

What can this configure? * Interfaces * Bridges * Bonds * Ports * Management VRF

The idea here is to be able to have a flexible interface that can be used for configuring Cumulus gear in any environment. It works especially well when paired with the quagga cookbook, allowing complete automation and templating for routing, switching, and management on a Cumulus device.

Requirements

Tested on: * Cumulus Linux 2.5.3

Recipes

cumulus-switch::default

The default recipe does nothing.

cumulus-switch::base

The base recipe enables configuration of: * Interfaces * Bridges * Bonds * Ports

cumulus-switch::isc-dhcp-relay

The isc-dhcp-relay recipe enables configuration of a dhcp relay. This is a temporary measure, and won't be here for long.

cumulus-switch::mgmt-vrf

The mgmt-vrf recipe enables configuration of a Management VRF (documentation)

Attributes

NOTE! Where you see "String or Array" for type, a String may be used only for single values. Use an Array of Strings for multiple values.

NOTE! Tests for virtual_mac and virtual_ip are currently failing due to a bug in the cumulus cookbook. To use these attributes, place both in the virtual_ip attribute (...['virtual_ip'] = 'AA:BB:CC:DD:EE:FF 10.0.0.1')

cumulus-switch::base

Interfaces & interface ranges

Attribute Description Type Default
node['cumulus']['interface'] A hash of interfaces. Keys are the interface name, values are a hash with optional configuration. Hash {}
node['cumulus']['interface'][$NAME] Configuration values for interface $NAME. This will be the base for the following attributes. Hash nil
['ipv4'] IPv4 address(s) to assign to the interface. String or Array nil
['ipv6'] IPv6 address(s) to assign to the interface. String or Array nil
['alias'] Interface alias (description). String nil
['speed'] Speed to configure for the interface. String nil
['mtu'] MTU to configure for the interface. Integer nil
['post_up'] Post-up command(s) to run String or Array nil
['pre_down'] Pre-down command(s) to run String or Array nil
['addr_method'] Address assignment method, dhcp or loopback. String nil
['virtual_mac'] VRR virtual MAC. String nil
['virtual_ip'] VRR virtual IP. String nil
['vids'] Array of VLANs to be configured for a VLAN aware trunk interface. Array nil
['pvid'] Native VLAN for a VLAN aware trunk interface. Integer nil
['mstpctl_portnetwork'] Enable bridge assurance on a VLAN aware trunk. Boolean nil
['mstpctl_portadminedge'] Enables admin edge port. Boolean nil
['mstpctl_bpduguard'] Enable BPDU guard on a VLAN aware trunk. Boolean nil
['clagd_enable'] Enable CLAGD on the interface (documentation). Boolean nil
['clagd_peer_ip'] Address of the CLAG peer switch String nil
['clagd_priority'] CLAG priority for this switch Integer nil
['clagd_sys_mac'] CLAG system MAC. The MAC must be identical on both of the CLAG peers. String nil
['clagd_args'] Any additional arguments to be passed to the clagd deamon. String nil

Note! You can use all of the above attributes on node['cumulus']['interface_range'][$NAME] as well. Use a a String in a format like swp[1-24].100 or swp[2-5] for $NAME.

Bridges

Attribute Description Type Default
node['cumulus']['bridge'] A hash of bridges. Keys are the bridge name, values are a hash with configuration for the bridge. Hash {}
node['cumulus']['bridge'][$NAME] Configuration values for bridge $NAME. This will be the base for the following attributes. Hash nil
['ports'] Interfaces to place in the bridge (required). Array required
['ipv4'] IPv4 address(s) to assign to the bridge. Array nil
['ipv6'] IPv6 address(s) to assign to the bridge. Array nil
['alias'] Interface alias (description). String nil
['addr_method'] Address assignment method, dhcp or loopback. String nil
['mtu'] MTU to configure for the interface. Integer nil
['post_up'] Post-up command(s) to run String or Array nil
['pre_down'] Pre-down command(s) to run String or Array nil
['vids'] Array of VLANs to be configured for a VLAN aware trunk interface. Array nil
['pvid'] Native VLAN for a VLAN aware trunk interface. Integer nil
['vlan_aware'] Use the VLAN aware bridge driver. Boolean false
['virtual_ip'] VRR virtual IP (documentation). String nil
['virtual_mac'] VRR virtual MAC address (documentation). String nil
['stp'] Enable STP on the bridge. Boolean true
['mstp_treeprio'] Bridge root priority. Must be multiple of 4096. Integer nil

Bonds

Attribute Description Type Default
node['cumulus']['bond'] A hash of bonds. Keys are the bond name, values are a hash with configuration for the bond. Hash {}
node['cumulus']['bond'][$NAME] Configuration values for bond $NAME. This will be the base for the following attributes. Hash nil
['slaves'] Bond members (required). Array required
['ipv4'] IPv4 address(s) to assign to the bond. String or Array nil
['ipv6'] IPv6 address(s) to assign to the bond. String or Array nil
['alias'] Interface alias (description). String nil
['mtu'] MTU to configure for the interface. Integer nil
['post_up'] Post-up command(s) to run String or Array nil
['pre_down'] Pre-down command(s) to run String or Array nil
['addr_method'] Address assignment method, dhcp or loopback. String nil
['virtual_mac'] VRR virtual MAC (needs to be fixed in cumulus cookbook). String nil
['virtual_ip'] VRR virtual IP (needs to be fixed in cumulus cookbook). String nil
['vids'] Array of VLANs to be configured for a VLAN aware trunk interface. Array nil
['pvid'] Native VLAN for a VLAN aware trunk interface. Integer nil
['miimon'] MII link monitoring interval. Integer 100
['min_links'] Minimum number of slave links for the bond to be considered up. Integer 1
['mode'] Bonding mode. String 802.3ad
['xmit_hash_policy'] TX hashing policy. String layer3+4
['lacp_rate'] LACP bond rate. Integer 1
['lacp_bypass_allow'] Enable LACP bypass. Set to 1 to enable (needs to be boolean). Integer nil
['mstpctl_portnetwork'] Enable bridge assurance on a VLAN aware trunk. Boolean nil
['mstpctl_portadminedge'] Enables admin edge port. Boolean nil
['mstpctl_bpduguard'] Enable BPDU guard on a VLAN aware trunk. Boolean nil
['clag_id'] Identifier for a CLAG bond. The ID must be the same on both CLAG peers. Integer nil

Ports

Attribute Description Type Default
node['cumulus']['restart_switchd'] Restart switchd when port changes are made. Boolean false
node['cumulus']['ports']['10g'] Array of ports to be configured for 10GbE. Array []
node['cumulus']['ports']['40g'] Array of ports to be configured for 40GbE. Array []
node['cumulus']['ports']['40g_div_4'] Array of ports to be configured for 40GbE split to 4 x 10GbE. Array []
node['cumulus']['ports']['4_by_10g'] Array of ports to be configured for 10GbE to be aggregated into 1 x 40GbE. Array []

cumulus-switch::mgmt_vrf

NOTE! With Cumulus Linux 3.x, this recipe can simply be included; no need to set any attributes.

Attribute Description Type Default
node['cumulus']['mgmt_vrf']['enabled'] In Cumulus Linux 2.x, this enables or disables management VRF (documentation). Note: this is nil by default, which causes no actions to be taken. true will install and configure the management vrf. false will remove the package and disable the management vrf. Boolean nil
node['cumulus']['mgmt_vrf']['restart_quagga'] In Cumulus Linux 2.x, this restarts Quagga if management VRF status changes. Boolean nil

Usage

Simply set the desired attributes (see Attributes section above) then call the applicable recipe.

Example

Coming soon, maybe

Contributing

Any form of contribution is welcome! Feature requests, bug reports, pull requests, whatever! If you add features, make sure there are tests for them, and if you change any code, make sure the existing tests all pass before creating a pull request.

Tests are run on Cumulus VX VMs using serverspec.

Testing requirements: * Vagrant + cumulus-vagrant plugin (vagrant plugin install vagrant-cumulus) * VirtualBox

To run the tests (after installing prerequisites): * bundle install * rake rubocop * foodcritic . * rake test

Author and License

Copyright 2015, DreamHost

License

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

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

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

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

2.1.1 (2017-08-04):

Features: - Cumulus Linux 3.x support (@floored1585)

Code Cleanup: - Style fixes (@floored1585)

Fixes: - Fix ifquery hash mapping (@nertwork)

0.1.6 (???):

Features: - add the following support in ::base to interface and interface-range: - alias - pre-down - virutal_mac - virtual_ip - vids - pvid - clagd_args - add the following support in ::base to bond: - addr_method - alias - mtu - miimon - min_links - mode - xmit_hash_policy - lacp_rate - lacp_bypass_period - lacp_bypass_priority - lacp_bypass_all_active - virtual_mac - vids - pvid - post_up - pre_down - add the following support in ::base to bridge: - mtu - alias - mstpctl_treeprio - post_up - pre_down - vids - pvid - vlan_aware - addr_method

Code Cleanup: - style fixes

0.1.5 (2015-11-10)

Features:

  • add Management VRF (documentation) support (@floored1585)
  • add STP option for bonds and interfaces (@nertwork)
  • add dhcp relay support (this will be moving out of here eventually) (@nertwork)
  • add clagd support for bonds (@nertwork)

Collaborator Number Metric
            

2.1.2 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.1.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

2.1.2 failed this metric

FC064: Ensure issues_url is set in metadata: cumulus-switch/metadata.rb:1
FC065: Ensure source_url is set in metadata: cumulus-switch/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cumulus-switch/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: cumulus-switch/metadata.rb:1
FC069: Ensure standardized license defined in metadata: cumulus-switch/metadata.rb:1
Run with Foodcritic Version 11.2.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

2.1.2 passed this metric

No Binaries Metric
            

2.1.2 passed this metric

Publish Metric
            

2.1.2 passed this metric

Supported Platforms Metric
            

2.1.2 failed this metric

cumulus-switch should declare what platform(s) it supports.

Testing File Metric
            

2.1.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

2.1.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number