Forge Home

cloudvision

Resource types for managing Arista CloudVision content

6,450 downloads

6,450 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.0 (latest)
released Oct 2nd 2017
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 6.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'aristanetworks-cloudvision', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add aristanetworks-cloudvision
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install aristanetworks-cloudvision --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

aristanetworks/cloudvision — version 1.0.0 Oct 2nd 2017

Puppet Module for Arista CloudVision

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for getting started developing the module
  8. Contributing - Contributing to this project
  9. License
  10. Release Notes

Overview

The CloudVision module for Puppet provides a set of resource types for managing content within Arista CloudVision Portal. The initial goal is to enable self-service updates of CloudVision configlets from a Puppet wrapper class.

The CloudVision Puppet module is freely provided to the open source community for automating CloudVision configurations. Support for the module is provided on a best effort basis by the Arista EOS+ team with support subscriptions available upon request. Please file any bugs, questions or enhancement requests using Github Issues

Module Description

Arista CloudVision is a dedicated toolset for managing and monitoring Arista EOS network systems. While very friendly to Network Engineers, it can be beneficial to enable self-service functions for other teams who use Puppet. This module provides the resource types for interacting with CloudVision components and wrapper classes to enable certain self-service functions.

Setup

sudo puppet module install aristanetworks-cloudvision

You may iuse the included host-port configuration templates or create your own in a data or profile module. These templates will be used by the included cloudvision_configlet defined type to configure a top-of-rack (TOR) switch. Name these templates such that they are easily recognizeable by the host deployment team as this is how they will select the port-profile to apply.

Example ERB template:

<%# cloudvision/templates/single_attached_vlan.erb -%>
interface Ethernet<%= @portnum %>
   description Host <%= @host %> managed by puppet template <%= @template %>
   switchport mode access
   switchport access vlan <%= @vlan %>
   no shutdown
!
end

Validation rules can be configured within Hiera to setup rules around which ports on a TOR switch are available for hosts to ensure Puppet will not accidentally affect network-facing ports such as MLAG peer-link or spine ports.

Example hieradata/dc01/common.yaml:

---
# Reserve the last-4 ports of a 64-port TOR for Spine links
cloudvision::switchport::auto_run: true
cloudvision::switchport::host_port_range:
  min: ‘1’
  max: ‘60’
cloudvision::switchport::rack_switch_map:
  A1: dc01-A1-tor.example.com
  A2: dc01-a2-tor.example.com

Finally, define the authentication credentials for Puppet to use when logging into CloudVision Portal in one of the following files: $PUPPET_HOME/.cloudvision.yaml, or a path defined in $CLOUDVISION_CONF in the Puppet user’s environment.

Example .cloudvision.yaml:

# Configuration file for the aristanetworks-cloudvision Puppet module.
# Please ensure that you make this readable ONLY but the user starting
#   the Puppet-server. Ex: chmod 0600
---
nodes:
  - 192.0.2.11
  - 192.0.2.12
  - 192.0.2.13
username: 'cvppuppetuser'
password: 'puppetuserpassword'

Usage

The host team can apply the cloudvision::switchport defined type to specify the rack, port number, and host port profile:

cloudvision::switchport { 'esx3-20':
  rack     => 'A2',
  port     => '15',
  template => 'cloudvision/single_attached_vlan.erb',
  vlan     => 123,
}

NOTE: template 'profile/esx_host.erb' loads file: $environment/modules/profile/templates/esx_host.erb

Advanced usage: directly use the configlet resource

cloudvision_configlet { 'dc1-rackb3-tor-port-2':
  containers => ['dc1-rackb3-tor.example.com'],
  content    => “interface Ethernet2\n   no shutdown\nend”,
}

Reference

The outward facing portion of this module are the defined types which sanitize and validate input parameters, combined with environment data, pulled from Hiera. It, then calls the cloudvision_configlet resource type to ensure the configlet exists with the desired content and is applied to the correct node. The cloudvision_configlet resource type uses cvprac, a RESTful API Client for CloudVision Portal, to communicate with a single or cluster of CVP servers. If auto_run is set to true, then the associated CVP task will be immediately executed, if necessary.

Limitations

Development

This module can be configured to run directly from source and configured to do local development, sending the commands to the node over HTTP. The following instructions explain how to configure your local development environment.

This module requires one dependency that must be checked out as a Git working copy in the context of ongoing development in addition to running Puppet from source.

The dependency is managed via the bundler Gemfile and the environment needs to be configured to use local Git copies:

cd /workspace
git clone https://github.com/aristanetworks/cvprac-rb
export GEM_RBEAPI_VERSION=file:///workspace/cvprac-rb

Once the dependencies are installed and the environment configured, then install all of the dependencies:

git clone https://github.com/aristanetworks/puppet-cloudvision
cd puppet-cloudvision
bundle install --path .bundle/gems

Once everything is installed, run the spec tests to make sure everything is working properly:

bundle exec rspec spec

To run just a single spec file:

bundle exec rake spec SPEC=spec/unit/puppet/provider/cloudvision_configlet/default_spec.rb

Contributing

Contributions to this project are welcomed in the form of issues (bugs, questions, enhancement proposals) and pull requests. All pull requests must be accompanied by unit tests and up-to-date doc-strings, otherwise the pull request will be rejected.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

See the LICENSE file.

Release Notes

See the CHANGELOG file.