arista-eos 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. data/.gitignore +41 -0
  2. data/.rubocop.yml +21 -0
  3. data/Gemfile +57 -0
  4. data/Guardfile +21 -0
  5. data/LICENSE +28 -0
  6. data/README.md +178 -0
  7. data/Rakefile +46 -0
  8. data/eos.gemspec +36 -0
  9. data/guide/.gitignore +2 -0
  10. data/guide/Makefile +177 -0
  11. data/guide/_static/arista_logo_jpg-11.jpg +0 -0
  12. data/guide/_static/favicon.ico +0 -0
  13. data/guide/conf.py +282 -0
  14. data/guide/cookbook.rst +135 -0
  15. data/guide/developing.rst +55 -0
  16. data/guide/faq.rst +30 -0
  17. data/guide/index.rst +25 -0
  18. data/guide/installation.rst +174 -0
  19. data/guide/license.rst +5 -0
  20. data/guide/overview.rst +35 -0
  21. data/guide/quickstart.rst +184 -0
  22. data/guide/release-notes-1.0.rst +37 -0
  23. data/guide/release-notes-1.1.rst +25 -0
  24. data/guide/release-notes.rst +10 -0
  25. data/guide/testing.rst +8 -0
  26. data/guide/troubleshooting.rst +26 -0
  27. data/guide/typedoc.rst +928 -0
  28. data/guide/types.rst +44 -0
  29. data/lib/eos.rb +8 -0
  30. data/lib/eos/version.rb +5 -0
  31. data/lib/puppet/provider/eos_acl_entry/default.rb +122 -0
  32. data/lib/puppet/provider/eos_command/default.rb +61 -0
  33. data/lib/puppet/provider/eos_ethernet/default.rb +96 -0
  34. data/lib/puppet/provider/eos_interface/default.rb +89 -0
  35. data/lib/puppet/provider/eos_ipinterface/default.rb +89 -0
  36. data/lib/puppet/provider/eos_mlag/default.rb +86 -0
  37. data/lib/puppet/provider/eos_mlag_interface/default.rb +90 -0
  38. data/lib/puppet/provider/eos_ntp_config/default.rb +68 -0
  39. data/lib/puppet/provider/eos_ntp_server/default.rb +69 -0
  40. data/lib/puppet/provider/eos_portchannel/default.rb +117 -0
  41. data/lib/puppet/provider/eos_snmp/default.rb +77 -0
  42. data/lib/puppet/provider/eos_stp_interface/default.rb +73 -0
  43. data/lib/puppet/provider/eos_switchport/default.rb +100 -0
  44. data/lib/puppet/provider/eos_system/default.rb +63 -0
  45. data/lib/puppet/provider/eos_vlan/default.rb +93 -0
  46. data/lib/puppet/provider/eos_vxlan/default.rb +104 -0
  47. data/lib/puppet/provider/eos_vxlan_vlan/default.rb +89 -0
  48. data/lib/puppet/provider/eos_vxlan_vtep/default.rb +70 -0
  49. data/lib/puppet/type/eos_acl_entry.rb +126 -0
  50. data/lib/puppet/type/eos_command.rb +75 -0
  51. data/lib/puppet/type/eos_ethernet.rb +101 -0
  52. data/lib/puppet/type/eos_interface.rb +79 -0
  53. data/lib/puppet/type/eos_ipinterface.rb +116 -0
  54. data/lib/puppet/type/eos_mlag.rb +133 -0
  55. data/lib/puppet/type/eos_mlag_interface.rb +85 -0
  56. data/lib/puppet/type/eos_ntp_config.rb +70 -0
  57. data/lib/puppet/type/eos_ntp_server.rb +52 -0
  58. data/lib/puppet/type/eos_portchannel.rb +189 -0
  59. data/lib/puppet/type/eos_snmp.rb +127 -0
  60. data/lib/puppet/type/eos_stp_interface.rb +94 -0
  61. data/lib/puppet/type/eos_switchport.rb +150 -0
  62. data/lib/puppet/type/eos_system.rb +69 -0
  63. data/lib/puppet/type/eos_vlan.rb +130 -0
  64. data/lib/puppet/type/eos_vxlan.rb +150 -0
  65. data/lib/puppet/type/eos_vxlan_vlan.rb +78 -0
  66. data/lib/puppet/type/eos_vxlan_vtep.rb +62 -0
  67. data/lib/puppet_x/eos/provider.rb +86 -0
  68. data/lib/puppet_x/eos/utils/helpers.rb +34 -0
  69. data/metadata.json +20 -0
  70. data/spec/fixtures/README +61 -0
  71. data/spec/fixtures/ethernet.json +9 -0
  72. data/spec/fixtures/fixture_stp.yaml +11 -0
  73. data/spec/fixtures/fixture_vxlan_get.yaml +11 -0
  74. data/spec/fixtures/ospf.json +13 -0
  75. data/spec/fixtures/snmp.json +6 -0
  76. data/spec/fixtures/varp.json +11 -0
  77. data/spec/spec_helper.rb +27 -0
  78. data/spec/support/fixtures.rb +74 -0
  79. data/spec/support/shared_examples_for_providers.rb +7 -0
  80. data/spec/support/shared_examples_for_types.rb +451 -0
  81. data/spec/unit/puppet/provider/eos_acl_entry/default_spec.rb +226 -0
  82. data/spec/unit/puppet/provider/eos_acl_entry/fixture_acl_entry.yaml +20 -0
  83. data/spec/unit/puppet/provider/eos_ethernet/default_spec.rb +226 -0
  84. data/spec/unit/puppet/provider/eos_ethernet/fixture_ethernet.yaml +8 -0
  85. data/spec/unit/puppet/provider/eos_interface/default_spec.rb +176 -0
  86. data/spec/unit/puppet/provider/eos_interface/fixture_interfaces.yaml +5 -0
  87. data/spec/unit/puppet/provider/eos_ipinterface/default_spec.rb +223 -0
  88. data/spec/unit/puppet/provider/eos_ipinterface/fixture_ipinterfaces.yaml +5 -0
  89. data/spec/unit/puppet/provider/eos_mlag/default_spec.rb +203 -0
  90. data/spec/unit/puppet/provider/eos_mlag/fixture_mlag.yaml +11 -0
  91. data/spec/unit/puppet/provider/eos_mlag_interface/default_spec.rb +177 -0
  92. data/spec/unit/puppet/provider/eos_mlag_interface/fixture_mlag.yaml +11 -0
  93. data/spec/unit/puppet/provider/eos_ntp_config/default_spec.rb +150 -0
  94. data/spec/unit/puppet/provider/eos_ntp_config/fixture_ntp.yaml +3 -0
  95. data/spec/unit/puppet/provider/eos_ntp_server/default_spec.rb +152 -0
  96. data/spec/unit/puppet/provider/eos_ntp_server/fixture_ntp.yaml +3 -0
  97. data/spec/unit/puppet/provider/eos_portchannel/default_spec.rb +271 -0
  98. data/spec/unit/puppet/provider/eos_portchannel/fixture_portchannels.yaml +10 -0
  99. data/spec/unit/puppet/provider/eos_snmp/default_spec.rb +193 -0
  100. data/spec/unit/puppet/provider/eos_snmp/fixture_snmp.yaml +6 -0
  101. data/spec/unit/puppet/provider/eos_stp_interface/default_spec.rb +138 -0
  102. data/spec/unit/puppet/provider/eos_switchport/default_spec.rb +250 -0
  103. data/spec/unit/puppet/provider/eos_switchport/fixture_switchports.yaml +7 -0
  104. data/spec/unit/puppet/provider/eos_system/default_spec.rb +129 -0
  105. data/spec/unit/puppet/provider/eos_system/fixture_system.yaml +2 -0
  106. data/spec/unit/puppet/provider/eos_vlan/default_spec.rb +228 -0
  107. data/spec/unit/puppet/provider/eos_vlan/fixture_vlans.yaml +6 -0
  108. data/spec/unit/puppet/provider/eos_vxlan/default_spec.rb +229 -0
  109. data/spec/unit/puppet/provider/eos_vxlan/fixture_vxlan.yaml +9 -0
  110. data/spec/unit/puppet/provider/eos_vxlan_vlan/default_spec.rb +148 -0
  111. data/spec/unit/puppet/provider/eos_vxlan_vtep/default_spec.rb +140 -0
  112. data/spec/unit/puppet/type/eos_acl_entry_spec.rb +103 -0
  113. data/spec/unit/puppet/type/eos_command_spec.rb +67 -0
  114. data/spec/unit/puppet/type/eos_ethernet_spec.rb +87 -0
  115. data/spec/unit/puppet/type/eos_interface_spec.rb +67 -0
  116. data/spec/unit/puppet/type/eos_ipinterface_spec.rb +84 -0
  117. data/spec/unit/puppet/type/eos_mlag_interface_spec.rb +62 -0
  118. data/spec/unit/puppet/type/eos_mlag_spec.rb +98 -0
  119. data/spec/unit/puppet/type/eos_ntp_config_spec.rb +58 -0
  120. data/spec/unit/puppet/type/eos_ntp_server_spec.rb +51 -0
  121. data/spec/unit/puppet/type/eos_portchannel_spec.rb +99 -0
  122. data/spec/unit/puppet/type/eos_snmp_spec.rb +87 -0
  123. data/spec/unit/puppet/type/eos_stp_interface_spec.rb +77 -0
  124. data/spec/unit/puppet/type/eos_switchport_spec.rb +88 -0
  125. data/spec/unit/puppet/type/eos_system_spec.rb +57 -0
  126. data/spec/unit/puppet/type/eos_vlan_spec.rb +86 -0
  127. data/spec/unit/puppet/type/eos_vxlan_spec.rb +100 -0
  128. data/spec/unit/puppet/type/eos_vxlan_vlan_spec.rb +73 -0
  129. data/spec/unit/puppet/type/eos_vxlan_vtep_spec.rb +52 -0
  130. data/tests/init.pp +12 -0
  131. metadata +437 -0
Binary file
@@ -0,0 +1,282 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # puppet_eos documentation build configuration file, created by
4
+ # sphinx-quickstart on Mon Apr 6 20:46:10 2015.
5
+ #
6
+ # This file is execfile()d with the current directory set to its
7
+ # containing dir.
8
+ #
9
+ # Note that not all possible configuration values are present in this
10
+ # autogenerated file.
11
+ #
12
+ # All configuration values have a default; values that are commented out
13
+ # serve to show the default.
14
+
15
+ import sys
16
+ import os
17
+
18
+ # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
19
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
20
+
21
+ if not on_rtd: # only import and set the theme if we're building docs locally
22
+ import sphinx_rtd_theme
23
+ html_theme = 'sphinx_rtd_theme'
24
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
25
+
26
+ # If extensions (or modules to document with autodoc) are in another directory,
27
+ # add these directories to sys.path here. If the directory is relative to the
28
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
29
+ #sys.path.insert(0, os.path.abspath('.'))
30
+
31
+ # -- General configuration ------------------------------------------------
32
+
33
+ # If your documentation needs a minimal Sphinx version, state it here.
34
+ #needs_sphinx = '1.0'
35
+
36
+ # Add any Sphinx extension module names here, as strings. They can be
37
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38
+ # ones.
39
+ extensions = [
40
+ 'sphinx.ext.viewcode',
41
+ ]
42
+
43
+ # Add any paths that contain templates here, relative to this directory.
44
+ templates_path = ['_templates']
45
+
46
+ # The suffix of source filenames.
47
+ source_suffix = '.rst'
48
+
49
+ # The encoding of source files.
50
+ #source_encoding = 'utf-8-sig'
51
+
52
+ # The master toctree document.
53
+ master_doc = 'index'
54
+
55
+ # General information about the project.
56
+ project = u'puppet_eos'
57
+ copyright = u'2015, Arista Networks - EOS+ Consulting Services'
58
+
59
+ # The version info for the project you're documenting, acts as replacement for
60
+ # |version| and |release|, also used in various other places throughout the
61
+ # built documents.
62
+ #
63
+ import re
64
+ p = re.compile("version\": \"(.*)\"")
65
+ with open("../metadata.json") as f:
66
+ data = f.read()
67
+ ver = p.search(data)
68
+ if ver:
69
+ version = ver.group(1)
70
+
71
+ #print "Version: {}".format(version)
72
+
73
+ # The short X.Y version.
74
+ #version = '1.0'
75
+ # The full version, including alpha/beta/rc tags.
76
+ #release = '1.0'
77
+ release = version
78
+
79
+ # The language for content autogenerated by Sphinx. Refer to documentation
80
+ # for a list of supported languages.
81
+ #language = None
82
+
83
+ # There are two options for replacing |today|: either, you set today to some
84
+ # non-false value, then it is used:
85
+ #today = ''
86
+ # Else, today_fmt is used as the format for a strftime call.
87
+ #today_fmt = '%B %d, %Y'
88
+
89
+ # List of patterns, relative to source directory, that match files and
90
+ # directories to ignore when looking for source files.
91
+ exclude_patterns = ['_build']
92
+
93
+ # The reST default role (used for this markup: `text`) to use for all
94
+ # documents.
95
+ #default_role = None
96
+
97
+ # If true, '()' will be appended to :func: etc. cross-reference text.
98
+ #add_function_parentheses = True
99
+
100
+ # If true, the current module name will be prepended to all description
101
+ # unit titles (such as .. function::).
102
+ #add_module_names = True
103
+
104
+ # If true, sectionauthor and moduleauthor directives will be shown in the
105
+ # output. They are ignored by default.
106
+ #show_authors = False
107
+
108
+ # The name of the Pygments (syntax highlighting) style to use.
109
+ pygments_style = 'sphinx'
110
+
111
+ # A list of ignored prefixes for module index sorting.
112
+ #modindex_common_prefix = []
113
+
114
+ # If true, keep warnings as "system message" paragraphs in the built documents.
115
+ #keep_warnings = False
116
+
117
+
118
+ # -- Options for HTML output ----------------------------------------------
119
+
120
+ # The theme to use for HTML and HTML Help pages. See the documentation for
121
+ # a list of builtin themes.
122
+ #html_theme = 'default'
123
+
124
+ # Theme options are theme-specific and customize the look and feel of a theme
125
+ # further. For a list of options available for each theme, see the
126
+ # documentation.
127
+ #html_theme_options = {}
128
+
129
+ # Add any paths that contain custom themes here, relative to this directory.
130
+ #html_theme_path = []
131
+
132
+ # The name for this set of Sphinx documents. If None, it defaults to
133
+ # "<project> v<release> documentation".
134
+ #html_title = None
135
+
136
+ # A shorter title for the navigation bar. Default is the same as html_title.
137
+ #html_short_title = None
138
+
139
+ # The name of an image file (relative to this directory) to place at the top
140
+ # of the sidebar.
141
+ #html_logo = None
142
+ html_logo = '_static/arista_logo_jpg-11.jpg'
143
+
144
+ # The name of an image file (within the static path) to use as favicon of the
145
+ # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
146
+ # pixels large.
147
+ #html_favicon = None
148
+ html_favicon = '_static/favicon.ico'
149
+
150
+ # Add any paths that contain custom static files (such as style sheets) here,
151
+ # relative to this directory. They are copied after the builtin static files,
152
+ # so a file named "default.css" will overwrite the builtin "default.css".
153
+ html_static_path = ['_static']
154
+
155
+ # Add any extra paths that contain custom files (such as robots.txt or
156
+ # .htaccess) here, relative to this directory. These files are copied
157
+ # directly to the root of the documentation.
158
+ #html_extra_path = []
159
+
160
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
161
+ # using the given strftime format.
162
+ #html_last_updated_fmt = '%b %d, %Y'
163
+
164
+ # If true, SmartyPants will be used to convert quotes and dashes to
165
+ # typographically correct entities.
166
+ #html_use_smartypants = True
167
+
168
+ # Custom sidebar templates, maps document names to template names.
169
+ #html_sidebars = {}
170
+
171
+ # Additional templates that should be rendered to pages, maps page names to
172
+ # template names.
173
+ #html_additional_pages = {}
174
+
175
+ # If false, no module index is generated.
176
+ #html_domain_indices = True
177
+
178
+ # If false, no index is generated.
179
+ #html_use_index = True
180
+
181
+ # If true, the index is split into individual pages for each letter.
182
+ #html_split_index = False
183
+
184
+ # If true, links to the reST sources are added to the pages.
185
+ #html_show_sourcelink = True
186
+
187
+ # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
188
+ #html_show_sphinx = True
189
+
190
+ # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
191
+ #html_show_copyright = True
192
+
193
+ # If true, an OpenSearch description file will be output, and all pages will
194
+ # contain a <link> tag referring to it. The value of this option must be the
195
+ # base URL from which the finished HTML is served.
196
+ #html_use_opensearch = ''
197
+
198
+ # This is the file name suffix for HTML files (e.g. ".xhtml").
199
+ #html_file_suffix = None
200
+
201
+ # Output file base name for HTML help builder.
202
+ htmlhelp_basename = 'puppet_eosdoc'
203
+
204
+
205
+ # -- Options for LaTeX output ---------------------------------------------
206
+
207
+ latex_elements = {
208
+ # The paper size ('letterpaper' or 'a4paper').
209
+ #'papersize': 'letterpaper',
210
+
211
+ # The font size ('10pt', '11pt' or '12pt').
212
+ #'pointsize': '10pt',
213
+
214
+ # Additional stuff for the LaTeX preamble.
215
+ #'preamble': '',
216
+ }
217
+
218
+ # Grouping the document tree into LaTeX files. List of tuples
219
+ # (source start file, target name, title,
220
+ # author, documentclass [howto, manual, or own class]).
221
+ latex_documents = [
222
+ ('index', 'puppet_eos.tex', u'puppet\\_eos Module Documentation',
223
+ u'Arista Networks - EOS+ Consulting Services', 'manual'),
224
+ ]
225
+
226
+ # The name of an image file (relative to this directory) to place at the top of
227
+ # the title page.
228
+ #latex_logo = None
229
+ latex_logo = '_static/arista_logo_jpg-11.jpg'
230
+
231
+ # For "manual" documents, if this is true, then toplevel headings are parts,
232
+ # not chapters.
233
+ #latex_use_parts = False
234
+
235
+ # If true, show page references after internal links.
236
+ #latex_show_pagerefs = False
237
+
238
+ # If true, show URL addresses after external links.
239
+ #latex_show_urls = False
240
+
241
+ # Documents to append as an appendix to all manuals.
242
+ #latex_appendices = []
243
+
244
+ # If false, no module index is generated.
245
+ #latex_domain_indices = True
246
+
247
+
248
+ # -- Options for manual page output ---------------------------------------
249
+
250
+ # One entry per manual page. List of tuples
251
+ # (source start file, name, description, authors, manual section).
252
+ man_pages = [
253
+ ('index', 'puppet_eos', u'puppet_eos Module Documentation',
254
+ [u'Arista Networks - EOS+ Consulting Services'], 1)
255
+ ]
256
+
257
+ # If true, show URL addresses after external links.
258
+ #man_show_urls = False
259
+
260
+
261
+ # -- Options for Texinfo output -------------------------------------------
262
+
263
+ # Grouping the document tree into Texinfo files. List of tuples
264
+ # (source start file, target name, title, author,
265
+ # dir menu entry, description, category)
266
+ texinfo_documents = [
267
+ ('index', 'puppet_eos', u'puppet_eos Module Documentation',
268
+ u'Arista Networks - EOS+ Consulting Services', 'puppet_eos', 'One line description of project.',
269
+ 'Miscellaneous'),
270
+ ]
271
+
272
+ # Documents to append as an appendix to all manuals.
273
+ #texinfo_appendices = []
274
+
275
+ # If false, no module index is generated.
276
+ #texinfo_domain_indices = True
277
+
278
+ # How to display URL addresses: 'footnote', 'no', or 'inline'.
279
+ #texinfo_show_urls = 'footnote'
280
+
281
+ # If true, do not generate a @detailmenu in the "Top" node's menu.
282
+ #texinfo_no_detailmenu = False
@@ -0,0 +1,135 @@
1
+ Cookbook
2
+ ============
3
+
4
+ .. contents:: :local:
5
+
6
+ Creating a Node Profile Manifest
7
+ --------------------------------
8
+
9
+ A common pattern is to use node profile manifests to define reusable blocks that get applied to individual nodes, as needed. Node profile manifests define contain classes which define the desired state for one or more settings. These profile classes are, then, assigned to nodes based on the node classification. Profile classes may use parameters (specified in a resource definition or Hiera) to allow customization per node.
10
+
11
+ Recipe 1: Masterless / Headless
12
+ -------------------------------
13
+
14
+ Puppet may be run in a masterless / headless manner. This method is useful for testing as well as full deployments. When running headless, modules, manifests, etc are made available to each node (NFS, wget, git, subversion) then are applied at the node with the ``puppet apply <manifest>`` command.
15
+
16
+ Recipe 2: MLAG
17
+ --------------
18
+
19
+ Below are two sample manifests (classes) that can be applied to nodes to configure MLAG between a spine and ToR switch.
20
+ This is a very basic example to illustrate the use of the eos types. A more useful class would accept variables or read data from hiera
21
+ to use for interface IDs, VLAN IDs, peer-addresses, etc.
22
+
23
+ Spine1 Sample
24
+ ^^^^^^^^^^^^^
25
+
26
+ .. code-block:: puppet
27
+
28
+ # Configure peer link and MLAG peer.
29
+ eos_vlan { "4094":
30
+ trunk_groups => ["mlagpeer"],
31
+ }
32
+ eos_interface { "Port-Channel10":
33
+ description => "MLAG Peer link",
34
+ ensure => present,
35
+ }
36
+ eos_portchannel { "Port-Channel10":
37
+ lacp_mode => active,
38
+ members => ["Ethernet1", "Ethernet2"],
39
+ }
40
+ eos_switchport { "Port-Channel10":
41
+ ensure => present,
42
+ mode => trunk,
43
+ # trunk_group => "mlagpeer",
44
+ }
45
+ eos_stp_config { "4094":
46
+ mode => "none",
47
+ }
48
+ eos_ipinterface { "Vlan4094":
49
+ address => "10.0.0.1/30",
50
+ }
51
+ eos_mlag { "Rack2":
52
+ local_interface => "Vlan4094",
53
+ peer_address => "10.0.0.2",
54
+ peer_link => "Port-Channel10",
55
+ domain_id => "mlag1",
56
+ enable => true,
57
+ }
58
+
59
+ # Configure downstream links
60
+ eos_portchannel { "Port-Channel3":
61
+ lacp_mode => active,
62
+ members => ["Ethernet2/4"],
63
+ }
64
+ eos_mlag_interface { "Port-Channel3":
65
+ mlag_id => 3,
66
+ ensure => present,
67
+ }
68
+ eos_switchport { "Port-Channel3":
69
+ ensure => present,
70
+ mode => trunk,
71
+ trunk_native_vlan => 300,
72
+ trunk_allowed_vlans => [301, 302, 303, 305, 306, 307],
73
+ }
74
+
75
+ # Create vlans
76
+ eos_vlan { "300":
77
+ vlan_name => "ztp_bootstrap",
78
+ ensure => present,
79
+ }
80
+
81
+ $vlans = ["301", "302", "303", "305", "306", "307"]
82
+ each($vlans) |$value| { eos_vlan { $value: ensure => present, } }
83
+
84
+
85
+ ToR Sample
86
+ ^^^^^^^^^^
87
+
88
+ .. code-block:: puppet
89
+
90
+ eos_interface { "Port-Channel3":
91
+ ensure => present,
92
+ description => "MLAG uplink to spine"
93
+ }
94
+ eos_switchport {'Ethernet1':
95
+ ensure => present,
96
+ }
97
+ eos_switchport {'Ethernet2':
98
+ ensure => present,
99
+ }
100
+ eos_portchannel { "Port-Channel3":
101
+ lacp_mode => active,
102
+ members => ["Ethernet1", "Ethernet2"],
103
+ }
104
+ eos_switchport { "Port-Channel3":
105
+ ensure => present,
106
+ mode => trunk,
107
+ trunk_native_vlan => 300,
108
+ trunk_allowed_vlans => [301, 302, 303, 305, 306, 307],
109
+ }
110
+
111
+ eos_switchport {'Ethernet3':
112
+ access_vlan => 302,
113
+ mode => access,
114
+ ensure => present,
115
+ }
116
+ eos_switchport {'Ethernet4':
117
+ access_vlan => 301,
118
+ mode => access,
119
+ ensure => present,
120
+ }
121
+
122
+ $vlans = ["301", "302", "303", "305", "306", "307"]
123
+
124
+ # In Puppet 3.7 with "parser = future"
125
+ #each($vlans) |$value| { eos_vlan { $value: ensure => present } }
126
+
127
+ # Existing syntax
128
+ define newvlan {
129
+ eos_vlan { $name:
130
+ ensure => present
131
+ }
132
+ }
133
+ newvlan { $vlans :
134
+ }
135
+
@@ -0,0 +1,55 @@
1
+ Developing
2
+ ==========
3
+
4
+ .. contents:: :local:
5
+
6
+ Overview
7
+ --------
8
+
9
+ This module can be configured to run directly from source and configured to do
10
+ local development, sending the commands to the node over HTTPS/HTTP. The
11
+ following instructions explain how to configure your local development
12
+ environment.
13
+
14
+ Running from source
15
+ -------------------
16
+
17
+ This module requires one dependency in addition to Puppet that must be checked
18
+ out as a Git working copy in the context of ongoing development in addition to
19
+ running Puppet from source.
20
+
21
+ * Ruby client for eAPI: `rbeapi <https://github.com/arista-eosplus/rbeapi>`_
22
+
23
+ The dependency is managed via the bundler Gemfile and the environment needs to
24
+ be configured to use local Git copies::
25
+
26
+ cd /workspace
27
+ git clone https://github.com/arista-eosplus/rbeapi.git
28
+ export GEM_RBEAPI_VERSION=file:///workspace/rbeapi
29
+
30
+ Once the dependencies are installed and the environment configured, then
31
+ install all of the dependencies::
32
+
33
+ git clone https://github.com/arista-eosplus/puppet-eos.git
34
+ cd puppet-eos
35
+ bundle install --path .bundle/gems
36
+
37
+ Once everything is installed, run the spec tests to make sure everything is
38
+ working properly::
39
+
40
+ bundle exec rspec spec
41
+
42
+ Finally, configure the eapi.conf file for rbeapi `See rbeapi for
43
+ details <https://github.com/arista-eosplus/rbeapi#example-eapiconf-file>`_ and
44
+ set the connection environment variable to run sanity tests
45
+ using `puppet resource`::
46
+
47
+ export RBEAPI_CONNECTION=veos01
48
+
49
+ Contributing
50
+ ------------
51
+
52
+ Contributions to this project are gladly welcomed in the form of issues (bugs,
53
+ questions, enhancement proposals) and pull requests. All pull requests must be
54
+ accompanied by spec unit tests and up-to-date inline docstrings otherwise the
55
+ pull request will be rejected.