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/guide/faq.rst
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
FAQ
|
2
|
+
===
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Server: Error: ... cannot load such file -- rbeapi/client
|
7
|
+
---------------------------------------------------------
|
8
|
+
|
9
|
+
If you see the following error on the master::
|
10
|
+
|
11
|
+
Server: Error: Could not autoload puppet/provider/eos_vlan/default: cannot load such file -- rbeapi/client
|
12
|
+
|
13
|
+
Install the rbeapi rubygem on the server::
|
14
|
+
|
15
|
+
sudo gem install rbeapi
|
16
|
+
|
17
|
+
Server: Error: ... provider 'eos': undefined method `api' for nil:NilClass`
|
18
|
+
---------------------------------------------------------------------------
|
19
|
+
|
20
|
+
If you try to apply a class or nmanifest and receive the following error::
|
21
|
+
|
22
|
+
Server: Error: Could not prefetch eos_vlan provider 'eos': undefined method `api' for nil:NilClass`
|
23
|
+
|
24
|
+
The eos provider requires a connection to an EOS device and cannot be applied on an OS that does not support Arista eAPI except in development mode.
|
25
|
+
|
26
|
+
Either ensure this manifest/class only gets applied to EOS devices or redirect eAPI communications on this system to a real or virtual EOS device::
|
27
|
+
|
28
|
+
export RBEAPI_CONF=/path/to/my/.eapi.conf
|
29
|
+
export RBEAPI_CONNECTION=<connection-name>
|
30
|
+
|
data/guide/index.rst
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
.. puppet_eos documentation master file, created by
|
2
|
+
sphinx-quickstart on Mon Apr 6 20:46:10 2015.
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
4
|
+
contain the root `toctree` directive.
|
5
|
+
|
6
|
+
Arista EOS Module for Puppet
|
7
|
+
============================
|
8
|
+
|
9
|
+
Contents:
|
10
|
+
|
11
|
+
.. toctree::
|
12
|
+
:maxdepth: 2
|
13
|
+
|
14
|
+
overview
|
15
|
+
quickstart
|
16
|
+
installation
|
17
|
+
types
|
18
|
+
cookbook
|
19
|
+
troubleshooting
|
20
|
+
developing
|
21
|
+
testing
|
22
|
+
faq
|
23
|
+
release-notes
|
24
|
+
license
|
25
|
+
|
@@ -0,0 +1,174 @@
|
|
1
|
+
Installation
|
2
|
+
============
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Configuring the Puppet Master
|
7
|
+
-----------------------------
|
8
|
+
|
9
|
+
Follow the standard practices for installing either Puppet Enterprise or Puppet Open-source master servers and your environment(s). As the paths to various items and specifics may vary from system to system, you might need to make minor adjustments to the instructions, below, to conform to your particular system. The command ``puppet confing print`` can assist you in locating the right directories.
|
10
|
+
|
11
|
+
On the master, install the `Forge: puppet-eos`_ module (Source: `GitHub: puppet-eos`_). This module is self-contained including the types and providers specific to EOS. There is also a `netdev_stdlib <https://forge.puppetlabs.com/netdevops/netdev_stdlib>`_ module in which PuppetLabs maintains a common set of Types in netdev_stdlib and the EOS providers are in `netdev_stdlib_eos <https://forge.puppetlabs.com/aristanetworks/netdev_stdlib_eos>`_.
|
12
|
+
|
13
|
+
Add the puppet-eos module to your server's modulepath:
|
14
|
+
|
15
|
+
Puppet installer::
|
16
|
+
|
17
|
+
$ puppet module install puppet-eos [--environment production ] [--modulepath $basemodulepath ]
|
18
|
+
|
19
|
+
Install from source::
|
20
|
+
|
21
|
+
$ git clone https://github.com/arista-eosplus/puppet-eos.git modulepath/eos
|
22
|
+
$ git checkout <version or branch>
|
23
|
+
|
24
|
+
Link using Git submodules::
|
25
|
+
|
26
|
+
$ git submodule add https://github.com/arista-eosplus/puppet-eos.git modulepath/eos
|
27
|
+
|
28
|
+
Bootstrapping EOS switches
|
29
|
+
--------------------------
|
30
|
+
|
31
|
+
There are a number of ways to bootstrap the necessary components on to a switch, and automatically load the minimal, initial configuration. We strongly suggest _`ZTP Server` to automate the steps from initial power-on to contacting the Puppet master.
|
32
|
+
|
33
|
+
Sample minimal configuration on a switch includes basic IP connectivity, hostname and domain-name which are used to generate the switch's SSL certificate, a name-server or host entry for "puppet", the default master name unless otherwise specified, and enabling eAPI (management api http-commands):
|
34
|
+
|
35
|
+
.. code-block:: console
|
36
|
+
|
37
|
+
!
|
38
|
+
hostname my-switch
|
39
|
+
ip name-server vrf default 8.8.8.8
|
40
|
+
ip domain-name example.com
|
41
|
+
ip host puppet 192.2.2.5
|
42
|
+
!
|
43
|
+
interface Management1
|
44
|
+
ip address 192.2.2.101/24
|
45
|
+
no shutdown
|
46
|
+
!
|
47
|
+
ip route 0.0.0.0/0 192.2.2.1
|
48
|
+
!
|
49
|
+
|
50
|
+
If EOS version is 4.14.5 or later
|
51
|
+
!
|
52
|
+
management api http-commands
|
53
|
+
no protocol https
|
54
|
+
protocol unix-socket
|
55
|
+
no shutdown
|
56
|
+
!
|
57
|
+
|
58
|
+
If EOS version is below 4.14.5
|
59
|
+
username eapi privilege 15 secret icanttellyou
|
60
|
+
!
|
61
|
+
management api http-commands
|
62
|
+
no shutdown
|
63
|
+
!
|
64
|
+
|
65
|
+
Install the puppet agent from `PuppetLabs`_::
|
66
|
+
|
67
|
+
Arista#copy http://myserver/puppet-enterprise-3.7.2-eos-4-i386.swix extensions:
|
68
|
+
Arista#extension puppet-enterprise-3.7.2-eos-4-i386.swix
|
69
|
+
Arista#copy installed-extensions boot-extensions
|
70
|
+
|
71
|
+
Install the rbeapi extension::
|
72
|
+
|
73
|
+
Arista#copy http://myserver/rbeapi-0.1.0.swix extensions:
|
74
|
+
Arista#extension rbeapi-0.1.0.swix
|
75
|
+
Arista#copy installed-extensions boot-extensions
|
76
|
+
|
77
|
+
Additional Puppet Master configuration
|
78
|
+
--------------------------------------
|
79
|
+
|
80
|
+
Configuring rbeapi
|
81
|
+
^^^^^^^^^^^^^^^^^^
|
82
|
+
|
83
|
+
Rbeapi, in many cases, requires a configuration file describing its connection method and credentials to eAPI on the switch. Available transports include https, http, http-local, and unix socket (EOS 4.14.5). Unix socket is recommended if available in the running version of EOS due to ease of configuration and security posture.
|
84
|
+
The /mnt/flash/eapi.conf file (also flash:eapi.conf) can be installed at bootstrap time or by puppet afterward. To do so with puppet, modify the sample files, below, to meet your needs.
|
85
|
+
|
86
|
+
Create the module skeleton on the Puppet master::
|
87
|
+
|
88
|
+
cd <modulepath>
|
89
|
+
puppet module generate <username-modulename>
|
90
|
+
mkdir <username-modulename>/templates/
|
91
|
+
|
92
|
+
Create an eapi.conf template in <modulepath>/<username-modulename>/templates/eapi.conf.erb
|
93
|
+
|
94
|
+
.. code-block:: erb
|
95
|
+
|
96
|
+
<%# rbeapi/templates/eapi.conf.erb %>
|
97
|
+
# Managed by Class['rbeapi']
|
98
|
+
[connection:localhost]
|
99
|
+
<% if @host -%>
|
100
|
+
host: <%= @host %>
|
101
|
+
<% end -%>
|
102
|
+
<% if @_transport != "http" -%>
|
103
|
+
transport: <%= @_transport %>
|
104
|
+
<% end -%>
|
105
|
+
<% if @_username != "admin" -%>
|
106
|
+
username: <%= @_username %>
|
107
|
+
<% end -%>
|
108
|
+
<% if @_password != "" -%>
|
109
|
+
password: <%= @_password %>
|
110
|
+
<% end -%>
|
111
|
+
<% if @port -%>
|
112
|
+
port: <%= @port %>
|
113
|
+
<% end -%>
|
114
|
+
|
115
|
+
Create a class that can be applied to nodes in <modulepath>/<username-modulename>/manifests/init.pp
|
116
|
+
|
117
|
+
.. code-block:: ruby
|
118
|
+
|
119
|
+
# modules/rbeapi/manifests/init.pp
|
120
|
+
# Example to configure eAPI for use with rbeapi
|
121
|
+
# class { rbeapi:
|
122
|
+
# username => eapi,
|
123
|
+
# password => icanttellyou,
|
124
|
+
# }
|
125
|
+
class rbeapi ($host = "localhost",
|
126
|
+
$transport = https,
|
127
|
+
$username = admin,
|
128
|
+
$password = "") {
|
129
|
+
|
130
|
+
package { 'rbeapi':
|
131
|
+
ensure => installed,
|
132
|
+
provider => 'gem',
|
133
|
+
}
|
134
|
+
|
135
|
+
# Check the EOS version (split in to major.minor.patch)
|
136
|
+
$section = split($::operatingsystemrelease, '\.')
|
137
|
+
$major = $section[0]
|
138
|
+
$minor = $section[1]
|
139
|
+
if $section[2] =~ /^(\d+)/ {
|
140
|
+
$patch = $1
|
141
|
+
} else {
|
142
|
+
$patch = 0
|
143
|
+
}
|
144
|
+
|
145
|
+
# eapi.conf can use "socket" starting with EOS 4.14.5
|
146
|
+
if $major >= 4 and $minor >= 14 and $patch >= 5 {
|
147
|
+
$_transport = socket
|
148
|
+
# The following defaults cause the template to skip
|
149
|
+
# user/pass sections
|
150
|
+
$_username = admin
|
151
|
+
$_password = ""
|
152
|
+
} else {
|
153
|
+
# Just pass through values we received
|
154
|
+
$_transport = $transport
|
155
|
+
$_username = $username
|
156
|
+
$_password = $password
|
157
|
+
}
|
158
|
+
|
159
|
+
# Populate the eapi.conf file
|
160
|
+
file { 'eapi.conf':
|
161
|
+
path => '/mnt/flash/eapi.conf',
|
162
|
+
ensure => file,
|
163
|
+
content => template("rbeapi/eapi.conf.erb"),
|
164
|
+
require => Package['rbeapi'],
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
.. target-notes::
|
169
|
+
|
170
|
+
.. _`Forge: puppet-eos`: https://forge.puppetlabs.com/aristanetworks/puppet-eos
|
171
|
+
.. _`Github: puppet-eos`: https://github.com/arista-eosplus/puppet-eos
|
172
|
+
.. _`ZTP Server`: https://github.com/arista-eosplus/ztpserver
|
173
|
+
.. _`PuppetLabs`: https://puppetlabs.com/download-puppet-enterprise-all#eos
|
174
|
+
|
data/guide/license.rst
ADDED
data/guide/overview.rst
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
Overview
|
2
|
+
========
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Introduction
|
7
|
+
------------
|
8
|
+
|
9
|
+
Puppet is a configuration management platform which operates by way of the user defining the desired state for a resource, puppet comparing that to the current state, then resolving any differences. By having an agent running on each node, puppet can not only be operated from a master, but can also be used in a standalone (masterless, headless) configuration.
|
10
|
+
|
11
|
+
This Type / Provider module enables Types specific for managing Arista EOS device configuration from Puppet. By defining profile classes around these types, network device management can be refocused to managing network applications such as ntp, stp, ospf, vxlan, or even abstracted away from a network-centric perspective in to higher level business goals such as deploying a new application service or site.
|
12
|
+
|
13
|
+
Puppet masters can be deployed in Enterprise or Open Source varieties providing various levels of tools and support, including dashboards and reporting. Such additional toolsets provide simplified configuration and rich analysis and auditing of an environment.
|
14
|
+
|
15
|
+
Terminology
|
16
|
+
-----------
|
17
|
+
|
18
|
+
When working with Puppet there is some basic terminology which is helpful to understand. A Type is resource that Puppet knows how to manage; a hostname, VLAN, layer-2 interface, etc. A Provider is the implementation-specific code that evaluates and effects change to the respective Type. There can be multiple Providers for a Type; for example: VLAN configuration may have a different provider for each OS vendor that it supports. A Module can consist of one or more Types and/or Providers packaged together or, it could be a grouping of related manifest classes, files, and templates.
|
19
|
+
|
20
|
+
Prerequisites
|
21
|
+
-------------
|
22
|
+
|
23
|
+
`PuppetLabs <http://puppetlabs.com/>`_ provides an EOS extension (SWIX file) for Arista switches that contains Ruby, the Puppet Enterprise agent and a number of dependencies for use with either Puppet Enterprise or Open Source Puppet masters.
|
24
|
+
|
25
|
+
On EOS, `eAPI <https://eos.arista.com/arista-eapi-101/>`_ must be initially enabled and the `rbeapi <https://github.com/arista-eosplus/rbeapi>`_ rubygem extension installed. These 2 components are used by the puppet modules to review the current state of resources and to bring them into compliance with the desired state.
|
26
|
+
|
27
|
+
On-switch Requirements:
|
28
|
+
|
29
|
+
* Puppet agent
|
30
|
+
|
31
|
+
* Ruby, etc.
|
32
|
+
|
33
|
+
* rbeapi rubygem
|
34
|
+
* eAPI enabled
|
35
|
+
|
@@ -0,0 +1,184 @@
|
|
1
|
+
Quick Start
|
2
|
+
===========
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Bootstrapping a switch
|
7
|
+
----------------------
|
8
|
+
|
9
|
+
There are a number of ways to bootstrap the necessary components on to a switch, and automatically load the minimal, initial configuration. We strongly suggest _`ZTP Server` to automate the steps from initial power-on to contacting the Puppet master.
|
10
|
+
|
11
|
+
Sample minimal configuration on a switch includes basic IP connectivity, hostname and domain-name which are used to generate the switch's SSL certificate, a name-server or host entry for "puppet", the default master name unless otherwise specified, and enabling eAPI (management api http-commands):
|
12
|
+
|
13
|
+
.. code-block:: console
|
14
|
+
|
15
|
+
!
|
16
|
+
hostname my-switch
|
17
|
+
ip domain-name example.com
|
18
|
+
!
|
19
|
+
ip name-server vrf default 8.8.8.8
|
20
|
+
! OR
|
21
|
+
ip host puppet 192.2.2.5
|
22
|
+
!
|
23
|
+
interface Management1
|
24
|
+
ip address 192.2.2.101/24
|
25
|
+
no shutdown
|
26
|
+
!
|
27
|
+
ip route 0.0.0.0/0 192.2.2.1
|
28
|
+
!
|
29
|
+
|
30
|
+
! If EOS version is 4.14.5 or higher, use unix-sockets
|
31
|
+
!
|
32
|
+
management api http-commands
|
33
|
+
no protocol https
|
34
|
+
protocol unix-socket
|
35
|
+
no shutdown
|
36
|
+
!
|
37
|
+
|
38
|
+
! If EOS version is below 4.14.5
|
39
|
+
username eapi privilege 15 secret icanttellyou
|
40
|
+
!
|
41
|
+
management api http-commands
|
42
|
+
no shutdown
|
43
|
+
!
|
44
|
+
|
45
|
+
If you configured eAPI (``management api http-commands``) for anything other than
|
46
|
+
``unix-socket``, then an ``flash:eapi.conf`` is also required. Ensure that the connection is ``localhost`` and enter the transport, port, username, and password required for the puppet module to connect to eAPI. See more about configuring `eapi.conf`_.
|
47
|
+
|
48
|
+
Example ``flash:eapi.conf``:
|
49
|
+
|
50
|
+
.. code-block:: console
|
51
|
+
|
52
|
+
[connection:localhost]
|
53
|
+
transport: https
|
54
|
+
port: 1234
|
55
|
+
username: eapi
|
56
|
+
password: password
|
57
|
+
enablepwd: itsasecret
|
58
|
+
|
59
|
+
Install the puppet agent from `PuppetLabs`_::
|
60
|
+
|
61
|
+
Arista#copy http://myserver/puppet-enterprise-3.7.2-eos-4-i386.swix extensions:
|
62
|
+
Arista#extension puppet-enterprise-3.7.2-eos-4-i386.swix
|
63
|
+
|
64
|
+
Install the `rbeapi extension`_::
|
65
|
+
|
66
|
+
Arista#copy http://myserver/rbeapi-0.1.0.swix extensions:
|
67
|
+
Arista#extension rbeapi-0.1.0.swix
|
68
|
+
|
69
|
+
Save the installed extensions::
|
70
|
+
|
71
|
+
Arista#copy installed-extensions boot-extensions
|
72
|
+
|
73
|
+
EOS Command Aliases
|
74
|
+
^^^^^^^^^^^^^^^^^^^
|
75
|
+
|
76
|
+
If working with puppet manually from the CLI, it may be convenient to add the following aliases to your systems
|
77
|
+
|
78
|
+
.. code-block:: console
|
79
|
+
|
80
|
+
alias pa bash sudo puppet agent --environment demo --waitforcert 30 --onetime true
|
81
|
+
alias puppet bash sudo puppet
|
82
|
+
|
83
|
+
With the above aliases, repetitive typing can be reduced to, for example:
|
84
|
+
|
85
|
+
.. code-block:: console
|
86
|
+
|
87
|
+
Arista#pa --test
|
88
|
+
Arista#puppet resource eos_vlan
|
89
|
+
Arista#puppet describe eos_vlan
|
90
|
+
|
91
|
+
Configuring the Puppet Master
|
92
|
+
-----------------------------
|
93
|
+
|
94
|
+
Follow the standard instructions for `installing either a Puppet Enterprise or Puppet Open-source master <https://docs.puppetlabs.com/>`_ server and setup your environment(s). (Standalone Puppet, also known as headless or masterless puppet, is covered in a separate section.) As the paths to various items and specifics may vary from system to system, you may need to make minor adjustments to the ommands, below, to conform to your particular system. Use ``puppet config print`` to locate the correct paths.
|
95
|
+
|
96
|
+
On the master, install the `Forge: puppet-eos`_ module (Source: `GitHub: puppet-eos`_). This module is self-contained including the types and providers specific to EOS.
|
97
|
+
|
98
|
+
.. note::
|
99
|
+
There is also a `netdev_stdlib <https://forge.puppetlabs.com/netdevops/netdev_stdlib>`_ module in which PuppetLabs maintains a cross-platform set of Types in netdev_stdlib and the EOS-specific providers are in `netdev_stdlib_eos <https://forge.puppetlabs.com/aristanetworks/netdev_stdlib_eos>`_.
|
100
|
+
|
101
|
+
Install the rbeapi rubygem on the server::
|
102
|
+
|
103
|
+
$ sudo gem install rbeapi
|
104
|
+
|
105
|
+
Add the puppet-eos module to your server's modulepath:
|
106
|
+
|
107
|
+
Puppet installer::
|
108
|
+
|
109
|
+
$ sudo puppet module install puppet-eos [--environment production ] [--modulepath $basemodulepath ]
|
110
|
+
|
111
|
+
Install from source::
|
112
|
+
|
113
|
+
$ sudo git clone https://github.com/arista-eosplus/puppet-eos.git <environment>/modules/eos
|
114
|
+
$ cd <environment>/modules/eos/
|
115
|
+
$ sudo git checkout <version or branch>
|
116
|
+
|
117
|
+
Link using Git submodules::
|
118
|
+
|
119
|
+
$ cd $moduledir
|
120
|
+
$ git submodule add https://github.com/arista-eosplus/puppet-eos.git eos
|
121
|
+
$ git submodule status
|
122
|
+
$ git submodule init
|
123
|
+
$ git status
|
124
|
+
|
125
|
+
Verifying the agent on EOS
|
126
|
+
--------------------------
|
127
|
+
|
128
|
+
Run the puppet agent on EOS. This performs several key tasks:
|
129
|
+
* Generate a keypair and request a certificate from the master
|
130
|
+
* Retrieve the CA and Master certificates
|
131
|
+
* Run pluginsync (enabled by default) to download the types and providers
|
132
|
+
* Run the defined manifests, if configured
|
133
|
+
|
134
|
+
.. code-block:: console
|
135
|
+
|
136
|
+
Arista#bash sudo puppet agent [--environment <env_name>] --test --onetime --no-daemonize --waitforcert 30
|
137
|
+
|
138
|
+
On the Master, sign the node's certificate request:
|
139
|
+
|
140
|
+
.. code-block:: console
|
141
|
+
|
142
|
+
$puppet cert list
|
143
|
+
$puppet cert sign <certname>
|
144
|
+
|
145
|
+
If you did not include ``waitforcert``, above, then re-run the puppet agent command to install the signed certificate from the server:
|
146
|
+
|
147
|
+
.. code-block:: console
|
148
|
+
|
149
|
+
Arista#bash sudo puppet agent [--environment <env_name>] --test --onetime --waitforcert 30
|
150
|
+
|
151
|
+
Verify that the ``eos_*`` types are available on the switch:
|
152
|
+
|
153
|
+
.. code-block:: console
|
154
|
+
|
155
|
+
Arista#bash sudo puppet resource --types [| grep eos]
|
156
|
+
|
157
|
+
View the current state of a type:
|
158
|
+
|
159
|
+
.. code-block:: console
|
160
|
+
|
161
|
+
Arista#bash sudo puppet resource eos_vlan
|
162
|
+
eos_vlan { '1':
|
163
|
+
ensure => 'present',
|
164
|
+
enable => 'true',
|
165
|
+
vlan_name => 'default',
|
166
|
+
}
|
167
|
+
|
168
|
+
View the description for a type:
|
169
|
+
|
170
|
+
.. code-block:: console
|
171
|
+
|
172
|
+
Arista#bash sudo puppet describe eos_vlan
|
173
|
+
|
174
|
+
If the steps, above, were not successful, proceed to the :ref:`troubleshooting` chapter.
|
175
|
+
|
176
|
+
.. target-notes::
|
177
|
+
|
178
|
+
.. _`eapi.conf`: https://github.com/arista-eosplus/rbeapi#example-eapiconf-file
|
179
|
+
.. _`Forge: puppet-eos`: https://forge.puppetlabs.com/aristanetworks/puppet-eos
|
180
|
+
.. _`Github: puppet-eos`: https://github.com/arista-eosplus/puppet-eos
|
181
|
+
.. _`ZTP Server`: https://github.com/arista-eosplus/ztpserver
|
182
|
+
.. _`PuppetLabs`: https://puppetlabs.com/download-puppet-enterprise-all#eos
|
183
|
+
.. _`rbeapi extension`: https://github.com/arista-eosplus/rbeapi
|
184
|
+
|