arista-eos 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +41 -0
- data/.rubocop.yml +21 -0
- data/Gemfile +57 -0
- data/Guardfile +21 -0
- data/LICENSE +28 -0
- data/README.md +178 -0
- data/Rakefile +46 -0
- data/eos.gemspec +36 -0
- data/guide/.gitignore +2 -0
- data/guide/Makefile +177 -0
- data/guide/_static/arista_logo_jpg-11.jpg +0 -0
- data/guide/_static/favicon.ico +0 -0
- data/guide/conf.py +282 -0
- data/guide/cookbook.rst +135 -0
- data/guide/developing.rst +55 -0
- data/guide/faq.rst +30 -0
- data/guide/index.rst +25 -0
- data/guide/installation.rst +174 -0
- data/guide/license.rst +5 -0
- data/guide/overview.rst +35 -0
- data/guide/quickstart.rst +184 -0
- data/guide/release-notes-1.0.rst +37 -0
- data/guide/release-notes-1.1.rst +25 -0
- data/guide/release-notes.rst +10 -0
- data/guide/testing.rst +8 -0
- data/guide/troubleshooting.rst +26 -0
- data/guide/typedoc.rst +928 -0
- data/guide/types.rst +44 -0
- data/lib/eos.rb +8 -0
- data/lib/eos/version.rb +5 -0
- data/lib/puppet/provider/eos_acl_entry/default.rb +122 -0
- data/lib/puppet/provider/eos_command/default.rb +61 -0
- data/lib/puppet/provider/eos_ethernet/default.rb +96 -0
- data/lib/puppet/provider/eos_interface/default.rb +89 -0
- data/lib/puppet/provider/eos_ipinterface/default.rb +89 -0
- data/lib/puppet/provider/eos_mlag/default.rb +86 -0
- data/lib/puppet/provider/eos_mlag_interface/default.rb +90 -0
- data/lib/puppet/provider/eos_ntp_config/default.rb +68 -0
- data/lib/puppet/provider/eos_ntp_server/default.rb +69 -0
- data/lib/puppet/provider/eos_portchannel/default.rb +117 -0
- data/lib/puppet/provider/eos_snmp/default.rb +77 -0
- data/lib/puppet/provider/eos_stp_interface/default.rb +73 -0
- data/lib/puppet/provider/eos_switchport/default.rb +100 -0
- data/lib/puppet/provider/eos_system/default.rb +63 -0
- data/lib/puppet/provider/eos_vlan/default.rb +93 -0
- data/lib/puppet/provider/eos_vxlan/default.rb +104 -0
- data/lib/puppet/provider/eos_vxlan_vlan/default.rb +89 -0
- data/lib/puppet/provider/eos_vxlan_vtep/default.rb +70 -0
- data/lib/puppet/type/eos_acl_entry.rb +126 -0
- data/lib/puppet/type/eos_command.rb +75 -0
- data/lib/puppet/type/eos_ethernet.rb +101 -0
- data/lib/puppet/type/eos_interface.rb +79 -0
- data/lib/puppet/type/eos_ipinterface.rb +116 -0
- data/lib/puppet/type/eos_mlag.rb +133 -0
- data/lib/puppet/type/eos_mlag_interface.rb +85 -0
- data/lib/puppet/type/eos_ntp_config.rb +70 -0
- data/lib/puppet/type/eos_ntp_server.rb +52 -0
- data/lib/puppet/type/eos_portchannel.rb +189 -0
- data/lib/puppet/type/eos_snmp.rb +127 -0
- data/lib/puppet/type/eos_stp_interface.rb +94 -0
- data/lib/puppet/type/eos_switchport.rb +150 -0
- data/lib/puppet/type/eos_system.rb +69 -0
- data/lib/puppet/type/eos_vlan.rb +130 -0
- data/lib/puppet/type/eos_vxlan.rb +150 -0
- data/lib/puppet/type/eos_vxlan_vlan.rb +78 -0
- data/lib/puppet/type/eos_vxlan_vtep.rb +62 -0
- data/lib/puppet_x/eos/provider.rb +86 -0
- data/lib/puppet_x/eos/utils/helpers.rb +34 -0
- data/metadata.json +20 -0
- data/spec/fixtures/README +61 -0
- data/spec/fixtures/ethernet.json +9 -0
- data/spec/fixtures/fixture_stp.yaml +11 -0
- data/spec/fixtures/fixture_vxlan_get.yaml +11 -0
- data/spec/fixtures/ospf.json +13 -0
- data/spec/fixtures/snmp.json +6 -0
- data/spec/fixtures/varp.json +11 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/fixtures.rb +74 -0
- data/spec/support/shared_examples_for_providers.rb +7 -0
- data/spec/support/shared_examples_for_types.rb +451 -0
- data/spec/unit/puppet/provider/eos_acl_entry/default_spec.rb +226 -0
- data/spec/unit/puppet/provider/eos_acl_entry/fixture_acl_entry.yaml +20 -0
- data/spec/unit/puppet/provider/eos_ethernet/default_spec.rb +226 -0
- data/spec/unit/puppet/provider/eos_ethernet/fixture_ethernet.yaml +8 -0
- data/spec/unit/puppet/provider/eos_interface/default_spec.rb +176 -0
- data/spec/unit/puppet/provider/eos_interface/fixture_interfaces.yaml +5 -0
- data/spec/unit/puppet/provider/eos_ipinterface/default_spec.rb +223 -0
- data/spec/unit/puppet/provider/eos_ipinterface/fixture_ipinterfaces.yaml +5 -0
- data/spec/unit/puppet/provider/eos_mlag/default_spec.rb +203 -0
- data/spec/unit/puppet/provider/eos_mlag/fixture_mlag.yaml +11 -0
- data/spec/unit/puppet/provider/eos_mlag_interface/default_spec.rb +177 -0
- data/spec/unit/puppet/provider/eos_mlag_interface/fixture_mlag.yaml +11 -0
- data/spec/unit/puppet/provider/eos_ntp_config/default_spec.rb +150 -0
- data/spec/unit/puppet/provider/eos_ntp_config/fixture_ntp.yaml +3 -0
- data/spec/unit/puppet/provider/eos_ntp_server/default_spec.rb +152 -0
- data/spec/unit/puppet/provider/eos_ntp_server/fixture_ntp.yaml +3 -0
- data/spec/unit/puppet/provider/eos_portchannel/default_spec.rb +271 -0
- data/spec/unit/puppet/provider/eos_portchannel/fixture_portchannels.yaml +10 -0
- data/spec/unit/puppet/provider/eos_snmp/default_spec.rb +193 -0
- data/spec/unit/puppet/provider/eos_snmp/fixture_snmp.yaml +6 -0
- data/spec/unit/puppet/provider/eos_stp_interface/default_spec.rb +138 -0
- data/spec/unit/puppet/provider/eos_switchport/default_spec.rb +250 -0
- data/spec/unit/puppet/provider/eos_switchport/fixture_switchports.yaml +7 -0
- data/spec/unit/puppet/provider/eos_system/default_spec.rb +129 -0
- data/spec/unit/puppet/provider/eos_system/fixture_system.yaml +2 -0
- data/spec/unit/puppet/provider/eos_vlan/default_spec.rb +228 -0
- data/spec/unit/puppet/provider/eos_vlan/fixture_vlans.yaml +6 -0
- data/spec/unit/puppet/provider/eos_vxlan/default_spec.rb +229 -0
- data/spec/unit/puppet/provider/eos_vxlan/fixture_vxlan.yaml +9 -0
- data/spec/unit/puppet/provider/eos_vxlan_vlan/default_spec.rb +148 -0
- data/spec/unit/puppet/provider/eos_vxlan_vtep/default_spec.rb +140 -0
- data/spec/unit/puppet/type/eos_acl_entry_spec.rb +103 -0
- data/spec/unit/puppet/type/eos_command_spec.rb +67 -0
- data/spec/unit/puppet/type/eos_ethernet_spec.rb +87 -0
- data/spec/unit/puppet/type/eos_interface_spec.rb +67 -0
- data/spec/unit/puppet/type/eos_ipinterface_spec.rb +84 -0
- data/spec/unit/puppet/type/eos_mlag_interface_spec.rb +62 -0
- data/spec/unit/puppet/type/eos_mlag_spec.rb +98 -0
- data/spec/unit/puppet/type/eos_ntp_config_spec.rb +58 -0
- data/spec/unit/puppet/type/eos_ntp_server_spec.rb +51 -0
- data/spec/unit/puppet/type/eos_portchannel_spec.rb +99 -0
- data/spec/unit/puppet/type/eos_snmp_spec.rb +87 -0
- data/spec/unit/puppet/type/eos_stp_interface_spec.rb +77 -0
- data/spec/unit/puppet/type/eos_switchport_spec.rb +88 -0
- data/spec/unit/puppet/type/eos_system_spec.rb +57 -0
- data/spec/unit/puppet/type/eos_vlan_spec.rb +86 -0
- data/spec/unit/puppet/type/eos_vxlan_spec.rb +100 -0
- data/spec/unit/puppet/type/eos_vxlan_vlan_spec.rb +73 -0
- data/spec/unit/puppet/type/eos_vxlan_vtep_spec.rb +52 -0
- data/tests/init.pp +12 -0
- metadata +437 -0
data/.gitignore
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/lib/bundler/man/
|
26
|
+
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
29
|
+
Gemfile.lock
|
30
|
+
.ruby-version
|
31
|
+
.ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
35
|
+
|
36
|
+
.DS_Store
|
37
|
+
|
38
|
+
# CI files
|
39
|
+
results
|
40
|
+
spec/fixtures/manifests/*
|
41
|
+
spec/fixtures/modules/*
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- '**/*.gemspec'
|
4
|
+
|
5
|
+
Metrics/CyclomaticComplexity:
|
6
|
+
Max: 20
|
7
|
+
|
8
|
+
Metrics/MethodLength:
|
9
|
+
Max: 20
|
10
|
+
|
11
|
+
Style/AccessorMethodName:
|
12
|
+
Enabled: False
|
13
|
+
|
14
|
+
Metrics/PerceivedComplexity:
|
15
|
+
Max: 20
|
16
|
+
|
17
|
+
Metrics/AbcSize:
|
18
|
+
Max: 50
|
19
|
+
|
20
|
+
Metrics/ClassLength:
|
21
|
+
Max: 130
|
data/Gemfile
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
2
|
+
|
3
|
+
def location_for(place, fake_version = nil)
|
4
|
+
mdata = /^(git[:@][^#]*)#(.*)/.match(place)
|
5
|
+
if mdata
|
6
|
+
hsh = { git: mdata[1], branch: mdata[2], require: false }
|
7
|
+
return [fake_version, hsh].compact
|
8
|
+
end
|
9
|
+
mdata2 = %r{^file:\/\/(.*)}.match(place)
|
10
|
+
if mdata2
|
11
|
+
return ['>= 0', { path: File.expand_path(mdata2[1]), require: false }]
|
12
|
+
end
|
13
|
+
[place, { require: false }]
|
14
|
+
end
|
15
|
+
|
16
|
+
gem 'inifile'
|
17
|
+
|
18
|
+
group :development do
|
19
|
+
gem 'guard'
|
20
|
+
gem 'guard-rspec'
|
21
|
+
gem 'guard-rubocop'
|
22
|
+
gem 'guard-shell'
|
23
|
+
end
|
24
|
+
|
25
|
+
group :development, :test do
|
26
|
+
gem 'yard'
|
27
|
+
gem 'redcarpet', '~> 3.1.2'
|
28
|
+
gem 'rake', '~> 10.1.0', require: false
|
29
|
+
gem 'rspec', '~> 3.0.0'
|
30
|
+
gem 'rspec-mocks', '~> 3.0.0'
|
31
|
+
gem 'pry', require: false
|
32
|
+
gem 'pry-doc', require: false
|
33
|
+
gem 'simplecov', require: false
|
34
|
+
gem 'simplecov-json', require: false
|
35
|
+
gem 'simplecov-rcov', require: false
|
36
|
+
gem 'puppetlabs_spec_helper'
|
37
|
+
gem 'puppet-lint'
|
38
|
+
gem 'metadata-json-lint', require: false
|
39
|
+
gem 'ci_reporter'
|
40
|
+
gem 'ci_reporter_rspec'
|
41
|
+
end
|
42
|
+
|
43
|
+
ENV['GEM_PUPPET_VERSION'] ||= ENV['PUPPET_GEM_VERSION']
|
44
|
+
puppetversion = ENV['GEM_PUPPET_VERSION']
|
45
|
+
if puppetversion
|
46
|
+
gem 'puppet', *location_for(puppetversion)
|
47
|
+
else
|
48
|
+
gem 'puppet', require: false
|
49
|
+
end
|
50
|
+
|
51
|
+
rbeapiversion = ENV['GEM_RBEAPI_VERSION']
|
52
|
+
if rbeapiversion
|
53
|
+
gem 'rbeapi', *location_for(rbeapiversion)
|
54
|
+
else
|
55
|
+
gem 'rbeapi', require: false
|
56
|
+
end
|
57
|
+
# vim:ft=ruby
|
data/Guardfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# A sample Guardfile
|
4
|
+
# More info at https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
7
|
+
watch(%r{^spec\/.+_spec\.rb$})
|
8
|
+
watch(%r{^lib\/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
9
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
10
|
+
end
|
11
|
+
|
12
|
+
guard :rubocop do
|
13
|
+
watch(/.+\.rb$/)
|
14
|
+
watch(%r{(?:.+\/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
15
|
+
end
|
16
|
+
|
17
|
+
group :docs do
|
18
|
+
guard :shell do
|
19
|
+
watch(%r{^lib\/(.+)\.rb$}) { |m| `yard doc #{m[0]} --quiet` }
|
20
|
+
end
|
21
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
Copyright (c) 2014-2015, Arista Networks EOS+
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
|
+
and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
* Neither the name of Arista Networks nor the names of its
|
15
|
+
contributors may be used to endorse or promote products derived from
|
16
|
+
this software without specific prior written permission.
|
17
|
+
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
data/README.md
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
# Puppet EOS Module
|
2
|
+
|
3
|
+
#### Table of Contents
|
4
|
+
|
5
|
+
1. [Overview](#overview)
|
6
|
+
2. [Module Description](#module-description)
|
7
|
+
3. [Setup](#setup)
|
8
|
+
* [What Puppet EOS affects](#what-puppet-eos-affects)
|
9
|
+
* [Setup requirements](#setup-requirements)
|
10
|
+
* [Beginning with NetDev EOS Providers](#beginning-eos)
|
11
|
+
4. [Usage - Configuration options and additional functionality](#usage)
|
12
|
+
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
|
13
|
+
6. [Limitations - OS compatibility, etc.](#limitations)
|
14
|
+
7. [Development - Guide for getting started developing the module](#development)
|
15
|
+
8. [Contributing - Contributing to this project](#contributing)
|
16
|
+
9. [License](#license)
|
17
|
+
10. [Release Notes](#release-notes)
|
18
|
+
|
19
|
+
|
20
|
+
## Overview
|
21
|
+
|
22
|
+
The Arista EOS module for Puppet provides a set of types and providers for
|
23
|
+
automating Arista EOS node configuraitons. The module allows for configuration
|
24
|
+
of EOS nodes using the Puppet agent running native in EOS.
|
25
|
+
|
26
|
+
The Puppet EOS modules are freely provided to the open source community for
|
27
|
+
automating Arista EOS node configurations using Puppet. Support for the
|
28
|
+
modules is provided on a best effort basis by the Arista EOS+ community.
|
29
|
+
Please file any bugs, questions or enhancement requests using [Github
|
30
|
+
Issues](http://github.com/arista-eosplus/puppet-eos/issues)
|
31
|
+
|
32
|
+
## Module Description
|
33
|
+
|
34
|
+
This module provides network abstractions for configuring network services on
|
35
|
+
Arista EOS nodes. The module provides a set of types and providers to serve as
|
36
|
+
building blocks for automating the configuration of Arista EOS nodes. This
|
37
|
+
module extends Puppet's capability to configure network devices including node
|
38
|
+
system services, access services and trunk side services of EOS nodes running
|
39
|
+
EOS 4.13 or later with the Puppet agent installed. The Puppet agent running on
|
40
|
+
the node will use pluginsync to download the types and providers from the Puppet
|
41
|
+
master and uses the Ruby Client for eAPI (rbeapi) to interface with the nodes
|
42
|
+
configuration.
|
43
|
+
|
44
|
+
## Setup
|
45
|
+
|
46
|
+
### What Puppet EOS affects
|
47
|
+
|
48
|
+
The types and providers in this module provide native abstractions for
|
49
|
+
configuring Arista EOS nodes.
|
50
|
+
|
51
|
+
### Setup Requirements
|
52
|
+
|
53
|
+
This module requires pluginsync in order to synchronize the types and providers
|
54
|
+
to the node. This module also requires the [Ruby Client for eAPI](rbeapi) to
|
55
|
+
be installed on the master and nodes.
|
56
|
+
|
57
|
+
### Beginning with eos
|
58
|
+
|
59
|
+
1. Install the module on the Puppet master
|
60
|
+
2. Install the rbeapi gem on the Puppet master [See Ruby Client for eAPI](rbeapi)
|
61
|
+
3. Install the rbeapi gem on the switch [See Ruby Client for eAPI](rbeapi)
|
62
|
+
4. Run the puppet agent on the switch to synchronize the types and providers
|
63
|
+
5. List the types by running `bash sudo puppet resource --types | grep eos`
|
64
|
+
from the EOS CLI enable mode
|
65
|
+
6. Verify the providrs by running `bash sudo puppet resource <resource>` from
|
66
|
+
the EOS CLI enable mode
|
67
|
+
|
68
|
+
```
|
69
|
+
Arista$ bash sudo puppet resource eos_vlan
|
70
|
+
eos_vlan { '1':
|
71
|
+
ensure => 'present',
|
72
|
+
enable => 'true',
|
73
|
+
vlan_name => 'default',
|
74
|
+
}
|
75
|
+
eos_vlan { '100':
|
76
|
+
ensure => 'present',
|
77
|
+
enable => 'true',
|
78
|
+
vlan_name => 'TEST_VLAN_100',
|
79
|
+
}
|
80
|
+
```
|
81
|
+
|
82
|
+
## Usage
|
83
|
+
|
84
|
+
See the [Documentation](http://puppet-eos.readthedocs.org/en/master/)
|
85
|
+
|
86
|
+
## Reference
|
87
|
+
|
88
|
+
See the [Type reference](http://puppet-eos.readthedocs.org/en/master/types.html) in the documentation
|
89
|
+
|
90
|
+
## Limitations
|
91
|
+
* Puppet 3.6 or later
|
92
|
+
* Ruby 1.9.3 or later
|
93
|
+
* [Arista EOS 4.13.7M or later](arista)
|
94
|
+
* [Ruby Client for eAPI 0.2.0 or later](rbeapi)
|
95
|
+
|
96
|
+
## Development
|
97
|
+
|
98
|
+
This module can be configured to run directly from source and configured to do
|
99
|
+
local development, sending the commands to the node over HTTP. The following
|
100
|
+
instructions explain how to configure your local development environment.
|
101
|
+
|
102
|
+
This module requires one dependency that must be checked out as a Git working
|
103
|
+
copy in the context of ongoing development in addition to running Puppet from
|
104
|
+
source.
|
105
|
+
|
106
|
+
* [rbeapi][rbeapi]
|
107
|
+
|
108
|
+
The dependency is managed via the bundler Gemfile and the environment needs to
|
109
|
+
be configured to use local Git copies:
|
110
|
+
|
111
|
+
cd /workspace
|
112
|
+
git clone https://github.com/arista-eosplus/rbeapi
|
113
|
+
export GEM_RBEAPI_VERSION=file:///workspace/rbeapi
|
114
|
+
|
115
|
+
Once the dependencies are installed and the environment configured, then
|
116
|
+
install all of the dependencies:
|
117
|
+
|
118
|
+
git clone https://github.com/arista-eosplus/puppet-eos
|
119
|
+
cd puppet-eos
|
120
|
+
bundle install --path .bundle/gems
|
121
|
+
|
122
|
+
Once everything is installed, run the spec tests to make sure everything is
|
123
|
+
working properly:
|
124
|
+
|
125
|
+
bundle exec rspec spec
|
126
|
+
|
127
|
+
Finally, configure the eapi.conf file for rbeapi [See rbeapi for
|
128
|
+
details][rbeapi] and set the connection enviroment variable to run sanity tests
|
129
|
+
using `puppet resource`:
|
130
|
+
|
131
|
+
export RBEAPI_CONNECTION=veos01
|
132
|
+
|
133
|
+
## Contributing
|
134
|
+
|
135
|
+
Contributions to this project are gladly welcomed in the form of issues (bugs,
|
136
|
+
questions, enhancement proposals) and pull requests. All pull requests must be
|
137
|
+
accompanied by spec unit tests and up-to-date doc-strings, otherwise the pull
|
138
|
+
request will be rejected.
|
139
|
+
|
140
|
+
## License
|
141
|
+
Copyright (c) 2014-2015, Arista Networks EOS+
|
142
|
+
All rights reserved.
|
143
|
+
|
144
|
+
Redistribution and use in source and binary forms, with or without
|
145
|
+
modification, are permitted provided that the following conditions are met:
|
146
|
+
|
147
|
+
* Redistributions of source code must retain the above copyright notice, this
|
148
|
+
list of conditions and the following disclaimer.
|
149
|
+
|
150
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
151
|
+
this list of conditions and the following disclaimer in the documentation
|
152
|
+
and/or other materials provided with the distribution.
|
153
|
+
|
154
|
+
* Neither the name of Arista Networks nor the names of its
|
155
|
+
contributors may be used to endorse or promote products derived from
|
156
|
+
this software without specific prior written permission.
|
157
|
+
|
158
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
159
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
160
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
161
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
162
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
163
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
164
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
165
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
166
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
167
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
168
|
+
|
169
|
+
## Release Notes
|
170
|
+
|
171
|
+
See the [Release Notes](http://puppet-eos.readthedocs.org/en/master/release-notes.html)
|
172
|
+
in the official documentation.
|
173
|
+
|
174
|
+
|
175
|
+
[rbeapi]: https://github.com/arista-eosplus/rbeapi
|
176
|
+
[arista]: http://www.arista.com
|
177
|
+
|
178
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'puppetlabs_spec_helper/rake_tasks'
|
4
|
+
require 'puppet-lint/tasks/puppet-lint'
|
5
|
+
require 'ci/reporter/rake/rspec'
|
6
|
+
PuppetLint.configuration.send('disable_80chars')
|
7
|
+
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp']
|
8
|
+
|
9
|
+
desc 'Prep CI RSpec tests'
|
10
|
+
task :ci_prep do
|
11
|
+
require 'rubygems'
|
12
|
+
begin
|
13
|
+
gem 'ci_reporter'
|
14
|
+
require 'ci/reporter/rake/rspec'
|
15
|
+
ENV['CI_REPORTS'] = 'results'
|
16
|
+
rescue LoadError
|
17
|
+
puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed'\
|
18
|
+
' to run the CI spec tests'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Run the CI RSpec tests'
|
23
|
+
task ci_spec: [:ci_prep, 'ci:setup:rspec', :spec]
|
24
|
+
|
25
|
+
desc 'Validate manifests, templates, and ruby files'
|
26
|
+
task :validate do
|
27
|
+
Dir['manifests/**/*.pp'].each do |manifest|
|
28
|
+
sh "puppet parser validate --noop #{manifest}"
|
29
|
+
end
|
30
|
+
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file|
|
31
|
+
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec\/fixtures}
|
32
|
+
end
|
33
|
+
Dir['templates/**/*.erb'].each do |template|
|
34
|
+
sh "erb -P -x -T '-' #{template} | ruby -c"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'Generate Getting Started Guide HTML'
|
39
|
+
task :guide do
|
40
|
+
system 'make -C guide html'
|
41
|
+
end
|
42
|
+
|
43
|
+
desc 'Clean Getting Started docs'
|
44
|
+
task :guide_clean do
|
45
|
+
system 'make -C guide clean'
|
46
|
+
end
|
data/eos.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'eos/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'arista-eos'
|
8
|
+
spec.version = Eos::VERSION
|
9
|
+
spec.authors = ['Peter Sprygada', 'John Corbin']
|
10
|
+
spec.email = ['sprygada@arista.com', 'jcorbin@arista.com']
|
11
|
+
spec.description = %q{Arista EOS Puppet modules to configure EOS devices}
|
12
|
+
spec.summary = %q{Type and provider implementation for Arista EOS devices}
|
13
|
+
spec.homepage = 'https://github.com/arista-eosplus/puppet-eos'
|
14
|
+
spec.license = 'BSD-3'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
# Development
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
23
|
+
spec.add_development_dependency 'rake'
|
24
|
+
spec.add_development_dependency 'guard'
|
25
|
+
spec.add_development_dependency 'guard-rspec'
|
26
|
+
spec.add_development_dependency 'guard-rubocop'
|
27
|
+
spec.add_development_dependency 'pry-doc'
|
28
|
+
spec.add_development_dependency 'pry'
|
29
|
+
# Testing
|
30
|
+
spec.add_development_dependency 'rspec-puppet'
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.0.0'
|
32
|
+
spec.add_development_dependency 'puppetlabs_spec_helper'
|
33
|
+
spec.add_development_dependency 'simplecov'
|
34
|
+
|
35
|
+
spec.add_dependency 'puppet'
|
36
|
+
end
|
data/guide/.gitignore
ADDED
data/guide/Makefile
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
# Makefile for Sphinx documentation
|
2
|
+
#
|
3
|
+
|
4
|
+
# You can set these variables from the command line.
|
5
|
+
SPHINXOPTS =
|
6
|
+
SPHINXBUILD = sphinx-build
|
7
|
+
PAPER =
|
8
|
+
BUILDDIR = _build
|
9
|
+
|
10
|
+
# User-friendly check for sphinx-build
|
11
|
+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
12
|
+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
13
|
+
endif
|
14
|
+
|
15
|
+
# Internal variables.
|
16
|
+
PAPEROPT_a4 = -D latex_paper_size=a4
|
17
|
+
PAPEROPT_letter = -D latex_paper_size=letter
|
18
|
+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
19
|
+
# the i18n builder cannot share the environment and doctrees with the others
|
20
|
+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
21
|
+
|
22
|
+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
23
|
+
|
24
|
+
help:
|
25
|
+
@echo "Please use \`make <target>' where <target> is one of"
|
26
|
+
@echo " html to make standalone HTML files"
|
27
|
+
@echo " dirhtml to make HTML files named index.html in directories"
|
28
|
+
@echo " singlehtml to make a single large HTML file"
|
29
|
+
@echo " pickle to make pickle files"
|
30
|
+
@echo " json to make JSON files"
|
31
|
+
@echo " htmlhelp to make HTML files and a HTML help project"
|
32
|
+
@echo " qthelp to make HTML files and a qthelp project"
|
33
|
+
@echo " devhelp to make HTML files and a Devhelp project"
|
34
|
+
@echo " epub to make an epub"
|
35
|
+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
36
|
+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
37
|
+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
38
|
+
@echo " text to make text files"
|
39
|
+
@echo " man to make manual pages"
|
40
|
+
@echo " texinfo to make Texinfo files"
|
41
|
+
@echo " info to make Texinfo files and run them through makeinfo"
|
42
|
+
@echo " gettext to make PO message catalogs"
|
43
|
+
@echo " changes to make an overview of all changed/added/deprecated items"
|
44
|
+
@echo " xml to make Docutils-native XML files"
|
45
|
+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
46
|
+
@echo " linkcheck to check all external links for integrity"
|
47
|
+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
48
|
+
|
49
|
+
clean:
|
50
|
+
rm -rf $(BUILDDIR)/*
|
51
|
+
|
52
|
+
html:
|
53
|
+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
54
|
+
@echo
|
55
|
+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
56
|
+
|
57
|
+
dirhtml:
|
58
|
+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
59
|
+
@echo
|
60
|
+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
61
|
+
|
62
|
+
singlehtml:
|
63
|
+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
64
|
+
@echo
|
65
|
+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
66
|
+
|
67
|
+
pickle:
|
68
|
+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
69
|
+
@echo
|
70
|
+
@echo "Build finished; now you can process the pickle files."
|
71
|
+
|
72
|
+
json:
|
73
|
+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
74
|
+
@echo
|
75
|
+
@echo "Build finished; now you can process the JSON files."
|
76
|
+
|
77
|
+
htmlhelp:
|
78
|
+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
79
|
+
@echo
|
80
|
+
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
81
|
+
".hhp project file in $(BUILDDIR)/htmlhelp."
|
82
|
+
|
83
|
+
qthelp:
|
84
|
+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
85
|
+
@echo
|
86
|
+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
87
|
+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
88
|
+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/puppet_eos.qhcp"
|
89
|
+
@echo "To view the help file:"
|
90
|
+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/puppet_eos.qhc"
|
91
|
+
|
92
|
+
devhelp:
|
93
|
+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
94
|
+
@echo
|
95
|
+
@echo "Build finished."
|
96
|
+
@echo "To view the help file:"
|
97
|
+
@echo "# mkdir -p $$HOME/.local/share/devhelp/puppet_eos"
|
98
|
+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/puppet_eos"
|
99
|
+
@echo "# devhelp"
|
100
|
+
|
101
|
+
epub:
|
102
|
+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
103
|
+
@echo
|
104
|
+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
105
|
+
|
106
|
+
latex:
|
107
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
108
|
+
@echo
|
109
|
+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
110
|
+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
111
|
+
"(use \`make latexpdf' here to do that automatically)."
|
112
|
+
|
113
|
+
latexpdf:
|
114
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
115
|
+
@echo "Running LaTeX files through pdflatex..."
|
116
|
+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
117
|
+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
118
|
+
|
119
|
+
latexpdfja:
|
120
|
+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
121
|
+
@echo "Running LaTeX files through platex and dvipdfmx..."
|
122
|
+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
123
|
+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
124
|
+
|
125
|
+
text:
|
126
|
+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
127
|
+
@echo
|
128
|
+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
129
|
+
|
130
|
+
man:
|
131
|
+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
132
|
+
@echo
|
133
|
+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
134
|
+
|
135
|
+
texinfo:
|
136
|
+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
137
|
+
@echo
|
138
|
+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
139
|
+
@echo "Run \`make' in that directory to run these through makeinfo" \
|
140
|
+
"(use \`make info' here to do that automatically)."
|
141
|
+
|
142
|
+
info:
|
143
|
+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
144
|
+
@echo "Running Texinfo files through makeinfo..."
|
145
|
+
make -C $(BUILDDIR)/texinfo info
|
146
|
+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
147
|
+
|
148
|
+
gettext:
|
149
|
+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
150
|
+
@echo
|
151
|
+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
152
|
+
|
153
|
+
changes:
|
154
|
+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
155
|
+
@echo
|
156
|
+
@echo "The overview file is in $(BUILDDIR)/changes."
|
157
|
+
|
158
|
+
linkcheck:
|
159
|
+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
160
|
+
@echo
|
161
|
+
@echo "Link check complete; look for any errors in the above output " \
|
162
|
+
"or in $(BUILDDIR)/linkcheck/output.txt."
|
163
|
+
|
164
|
+
doctest:
|
165
|
+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
166
|
+
@echo "Testing of doctests in the sources finished, look at the " \
|
167
|
+
"results in $(BUILDDIR)/doctest/output.txt."
|
168
|
+
|
169
|
+
xml:
|
170
|
+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
171
|
+
@echo
|
172
|
+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
173
|
+
|
174
|
+
pseudoxml:
|
175
|
+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
176
|
+
@echo
|
177
|
+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|