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

eos (6) Versions 1.0.2

Manage Arista EOS device running-config

Berkshelf/Librarian
Policyfile
Knife
cookbook 'eos', '= 1.0.2'
cookbook 'eos', '= 1.0.2', :supermarket
knife cookbook site install eos
knife cookbook site download eos
README
Dependencies
Changelog
Quality 0%

eos Cookbook for Arista EOS

Build Status

The eos cookbook simplifies management of Arista EOS network devices. Arista EOS uses the standard el6 32-bit Chef client. By including the eos::default recipe in the runlist, it will perform the following actions needed on EOS: - Relocate /etc/chef to /persist/sys/chef with a symlink back to /etc/chef. This ensures local configuration and state will be retained after a reload. - Enable eAPI (‘management api http-commands’) with unix-sockets as the transport in the running-config - Add/enhance several ohai plugins

Requirements

This cookbook is designed and tested with Chef 12 and EOS 4.15, 4.16, and 4.17. Other versions are likely to work but may not be fully tested.

  • Arista EOS 4.15 or greater
  • Chef client 32-bit RPM for RedHat/CentOS/el
  • Arista Ruby client for eAPI (rbeapi) rubygem and dependencies:
    • rbeapi 1.0 or greater which requires:
      • netaddr
      • net_http_unix
      • inifile

Installing

Installing Chef on an Arista switch requires the following steps. While the manual steps are displayed, below, for reference, it is suggested to use a tool such as Arista CloudVision or ZTP Server to take advantage of the zero-touch provisioning capability of Arista devices to load a desired EOS version, additional packages, and a base config, automatically.

  • Download the Chef client for RedHat/CentOS (32-bit)
  • Copy the rpm to the switch.

    Arista#copy http://my_server/path/chef-12.6.0-1.el6.i386.rpm extension:
    
  • Install the RPM:

    Arista#extension chef-12.6.0-1.el6.i386.rpm
    
  • Configure EOS to install the chef-client automatically after reloads

    Arista#copy installed-extensions boot-extensions
    
  • Ensure recipe[‘eos’] is in the default runlist for EOS devices

Installing behind a firewall

By default, the chef_gem resource will reach out to rubygems.org to find the necessary rubygems. When installing on devices without access to the Internet, additional steps are required. These, too, should be automated whenever possible.

Two common solutions are to bootstrap the device with an rbeapi extension or let chef_gem manage the rubygems, directly.

Install rbeapi as an EOS extension

  • Download the rbeapi extension named rbeapi-chef-<version>.swix
  • Copy the extension to the switch.

    Arista#copy http://my_server/path/rbeapi-chef-1.0-1.swix extension:
    
  • Install the extension:

    Arista#extension rbeapi-chef-1.0-1.swix
    
  • Configure EOS to install rbeapi automatically after reloads

    Arista#copy installed-extensions boot-extensions
    

Install rbeapi with chef_gem

Download the rubygem binaries to be included in the cookbook, then use a recipe to install those on devices. Example:

Download the rubygem binaries:

gem fetch inifile
gem fetch netaddr
gem fetch net_http_unix
gem fetch rbeapi

Then, create a recipe to copy these files to nodes and install the packages:

cookbook_file “#{Chef::Config[:file_cache_path]}/rbeapi.gem” do
  source ‘rbeapi-1.0.gem’
end
resources(:cookbook_file => “#{Chef::Config[:file_cache_path]}/rbeapi.gem”).run_action(:create)

chef_gem ‘rbeapi’ do
  source “#{Chef::Config[:file_cache_path]}/rbeapi.gem”
  version ‘1.0’
  compile_time false
  action :upgrade
end

NOTE: the chef_gem resource requires the version to be specified when installing from a local file.

Finally, include that recipe in the EOS device’s default runlist. recipe[eos::rbeapi_local]

Using

There are 2 general methods to use this cookbook to manage an Arista switch: Managing the entire config as a whole or using discrete resources. The eos_switchconfig resource manages the running-config from a template or file. Discrete resources, such as eos_vlan, provide selective, granular management of individual components. Eos_switchconfig is the recommended method for most network teams. However, eos_vlan is provided to serve as an example for additional discrete resources to be managed, if desired.

eos_switchconfig

eos_switchconfig 'running-config' do
  action :create
  source 'eos_config.erb'
  variables({
    hostname: 'veos01',
    domainname: 'example.com',
    nameservers: ['10.0.2.3'],
    ntp_server: '10.0.2.3',
    ntp_source_intf: 'Management1',
    static_routes: {
      '0.0.0.0/0' => '10.0.2.2'
    },
    l3ports: [
      Ethernet1: {
        ip_addr: '192.168.8.2/24'
      }
    ],
    l2ports: [
      Ethernet2: {},
      Ethernet3: {},
      Ethernet4: {}
    ]
  })
end

eos_vlan

eos_vlan '1' do
  vlan_name 'default'
  enable false
end

eos_vlan '100' do
  vlan_name 'Test_vlan'
  enable true
  trunk_groups %w(mlag_ctl test)
end

For more examples, see the test recipes.

Contributing

Community contributions are welcome. Please ensure all pull-requests include spec tests. See CONTRIBUTING for more detail.

Authors & Support

For support, please open a GitHub issue. This module is maintained by Arista EOS+ Consulting Services. Commercial support options are available upon request.

License

All files in this package are covered by the included BSD 3-clause license unless otherwise noted.

Dependent cookbooks

ohai ~> 4.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Change Log

1.0.2 (2016-11-03)

Full Changelog

Merged pull requests:

v1.0.1 (2016-10-10)

Full Changelog

Merged pull requests:

v1.0 (2016-10-10)

Full Changelog

Implemented enhancements:

Merged pull requests:

0.1.4 (2013-11-26)

  • updated providers to support new attributes in Devops Extension

0.1.3 (2013-09-04)

  • updated provider to use the Devops Extension for EOS

0.1.2 (2013-07-19)

  • fixed bug found with portchannel data bag entries
  • added some additional debug messages to aid with troubleshooting
  • change ohai plugin attributes from default to normal for plugin path
  • fixed minor issue with get_config to find the right attribute

0.1.1 (2013-07-02)

  • fixed bug found in edit_portchannel in lag provider
  • added initial support for ohai
  • added ohai plugin (eos/version)

0.1.0 (2013-07-01)

  • Initial release of eos cookbook
  • Initial release of interface (resource/provider/recipe)
  • Initial release of vlan (resource/provider/recipe)
  • Initial release of switchport (resource/provider/recipe)
  • Initial release of portchannel (resource/provider/recipe)

* This Change Log was automatically generated by github_changelog_generator

Collaborator Number Metric
            

1.0.2 failed this metric

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

Foodcritic Metric
            

1.0.2 failed this metric

FC033: Missing template: /tmp/cfdb48a22eb3ead31bab9efe/eos/recipes/template.rb:1
Run with Foodcritic Version 8.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any