Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
As part of the Broadcom Linux RPM distribution, Broadcom supplies a Chef client that runs on the switch. Chef is a tool that automates infrastructure deployment. See http://www.opscode.com for more information.
The chef directory inside the examples folder contains an example cookbook and role that utilizes the Ruby OpEN API.
It is assumed that the reader is familiar with the concepts of Chef:
For details on how to install the Chef client on a Broadcom switch see the OpEN API and Chef section.
The boa cookbook is available in the ADK in the examples/chef/cookbooks/boa directory. A set of example recipes related to VLANs, Logging, User Manager Accounting and User Manager Authentication, are located in the recipes directory within that directory. These recipes utilize the Ruby SWIG OpEN API to configure the switch according to the corresponding attributes in the node. These are very simplistic recipes designed to illustrate how to use the Broadcom OpEN API of different components from within a Ruby recipe.
The attributes of the node are assigned from the attributes directory of the recipe, or via a role as described in the Broadcom Switch Role section below.
An example tor-switch role is provided in the examples/chef/roles/tor-switch.json file. This role does two things:
Once this role is assigned to a Broadcom switch, as part of the vlans.rb recipe, all VLANs will be configured according to the 'vlans' attribute, as part of user_mgr_auth.rb recipe, the user manager authentication parameters are configured according to the 'authentication' attribute, as part of user_mgr_acct.rb recipe, user manager accounting parameters are configured according to the 'accounting' attribute and as part of logging.rb recipe, the logging parameters are configured according to the 'syslog' attribute.
The recipes will reconfigure the switch on a periodic basis (30-mins by default).
To test this role, for vlans.rb recipe:
To test this role, for user_mgr_auth.rb recipe:
To test this role, for user_mgr_acct.rb recipe:
To test this role, for logging.rb recipe:
To use the Broadcom Cookbook and Role you can do either of the following
Or
knife client configure ./.chef
in the examples/chef directory to create a .chef directory that contains client.rb and validation.pem. Edit client.rb to match your configuration.Once you have done one of the above use knife cookbook upload -a
to upload the cookbooks. You can then use knife or the Chef Server web interface to add any of the recipes to a node's run_list, or to assign a node the tor-switch role.