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
@@ -0,0 +1,69 @@
1
+ #
2
+ # Copyright (c) 2014, Arista Networks, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # Redistributions of source code must retain the above copyright notice,
10
+ # this list of conditions and the following disclaimer.
11
+ #
12
+ # Redistributions in binary form must reproduce the above copyright
13
+ # notice, this list of conditions and the following disclaimer in the
14
+ # documentation and/or other materials provided with the distribution.
15
+ #
16
+ # Neither the name of Arista Networks nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARISTA NETWORKS
24
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ #
32
+
33
+ Puppet::Type.newtype(:eos_system) do
34
+ @doc = <<-EOS
35
+ This type manages the global EOS node settings. It provides
36
+ configuration of global node attributes.
37
+ EOS
38
+
39
+ # Parameters
40
+
41
+ newparam(:name) do
42
+ desc <<-EOS
43
+ The name parameter identifies the global node instance for
44
+ configuration and should be configured as 'settings'. All
45
+ other values for name will be siliently ignored by the eos_system
46
+ provider.
47
+ EOS
48
+ isnamevar
49
+ end
50
+
51
+ # Properties (state management)
52
+
53
+ newproperty(:hostname) do
54
+ desc <<-EOS
55
+ The global system hostname is a locally significant value that
56
+ identifies the host portion of the nodes fully qualified domain
57
+ name (FQDN).
58
+
59
+ The default hostname for a new system is localhost'
60
+ EOS
61
+
62
+ validate do |value|
63
+ case value
64
+ when String then super(resource)
65
+ else fail "value #{value.inspect} is invalid, must be a String."
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,130 @@
1
+ #
2
+ # Copyright (c) 2014, Arista Networks, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # Redistributions of source code must retain the above copyright notice,
10
+ # this list of conditions and the following disclaimer.
11
+ #
12
+ # Redistributions in binary form must reproduce the above copyright
13
+ # notice, this list of conditions and the following disclaimer in the
14
+ # documentation and/or other materials provided with the distribution.
15
+ #
16
+ # Neither the name of Arista Networks nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARISTA NETWORKS
24
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ #
32
+
33
+ Puppet::Type.newtype(:eos_vlan) do
34
+ @doc = <<-EOS
35
+ This type provides management of VLANs on the Arista EOS node from
36
+ within Puppet.
37
+ EOS
38
+
39
+ ensurable
40
+
41
+ def munge_boolean(value)
42
+ case value
43
+ when true, 'true', :true, 'yes', 'on'
44
+ :true
45
+ when false, 'false', :false, 'no', 'off'
46
+ :false
47
+ else
48
+ fail('munge_boolean only takes booleans')
49
+ end
50
+ end
51
+
52
+ # Parameters
53
+
54
+ newparam(:vlanid, namevar: true) do
55
+ desc <<-EOS
56
+ The name parameter specifies the VLAN ID to manage on the
57
+ node. The VLAN ID parameter must be in the valid VLAN ID
58
+ range of 1 to 4094 expressed as a String.
59
+ EOS
60
+
61
+ # Make sure we have a string for the ID
62
+ munge do |value|
63
+ Integer(value).to_s
64
+ end
65
+
66
+ validate do |value|
67
+ unless value.to_i.between?(1, 4_094)
68
+ fail "value #{value.inspect} must be between 1 and 4094"
69
+ end
70
+ end
71
+ end
72
+
73
+ # Properties (state management)
74
+
75
+ newproperty(:vlan_name) do
76
+ desc <<-EOS
77
+ The vlan_name property configures the alphanumber VLAN name
78
+ setting in EOS. TThe name consists of up to 32 characters. The
79
+ system will automatically truncate any value larger than 32
80
+ characters.
81
+ EOS
82
+
83
+ validate do |value|
84
+ unless value =~ /[^\s]/
85
+ fail "value #{value.inspect} is invalid, must not contain spaces"
86
+ end
87
+ end
88
+ end
89
+
90
+ newproperty(:enable, boolean: true) do
91
+ desc <<-EOS
92
+ The enable property configures the administrative state of the
93
+ VLAN ID. When enable is configured as true, the ports forward traffic
94
+ configured with the specified VLAN and when enable is false, the
95
+ specified VLAN ID is blocked. Valid VLAN ID values:
96
+
97
+ * true - Administratively enable (active) the VLAN
98
+ * false - Administratively disable (suspend) the VLAN
99
+ EOS
100
+
101
+ newvalues(:true, :false)
102
+
103
+ munge do |value|
104
+ @resource.munge_boolean(value)
105
+ end
106
+ end
107
+
108
+ newproperty(:trunk_groups, array_matching: :all) do
109
+ desc <<-EOS
110
+ The trunk_groups property assigns an array of trunk group names to
111
+ the specified VLANs. A trunk group is the set of physical interfaces
112
+ that comprise the trunk and the collection of VLANs whose traffic
113
+ is carried only on ports that are members of the trunk gorups to which
114
+ the VLAN belongs
115
+
116
+ Example configuration
117
+
118
+ trunk_groups => ['group1', 'group2']
119
+
120
+ The default configure is an empty list
121
+ EOS
122
+
123
+ validate do |value|
124
+ case value
125
+ when String then super(value)
126
+ else fail "value #{value.inspect} is invalid, elements must be Strings"
127
+ end
128
+ end
129
+ end
130
+ end
@@ -0,0 +1,150 @@
1
+ #
2
+ # Copyright (c) 2014, Arista Networks, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # Redistributions of source code must retain the above copyright notice,
10
+ # this list of conditions and the following disclaimer.
11
+ #
12
+ # Redistributions in binary form must reproduce the above copyright
13
+ # notice, this list of conditions and the following disclaimer in the
14
+ # documentation and/or other materials provided with the distribution.
15
+ #
16
+ # Neither the name of Arista Networks nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARISTA NETWORKS
24
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ #
32
+ # encoding: utf-8
33
+
34
+ require 'puppet_x/eos/utils/helpers'
35
+
36
+ Puppet::Type.newtype(:eos_vxlan) do
37
+ @doc = <<-EOS
38
+ This type mananges VXLAN interface configuration on Arista
39
+ EOS nodes. It provides configuration of logical Vxlan interface
40
+ instances and settings
41
+ EOS
42
+
43
+ ensurable
44
+
45
+ # Parameters
46
+
47
+ newparam(:name) do
48
+ desc <<-EOS
49
+ The name parameter specifies the name of the Vxlan
50
+ interface to configure. The value must be the full
51
+ interface name identifier that corresponds to a valid
52
+ interface name in EOS.
53
+ EOS
54
+
55
+ validate do |value|
56
+ unless value =~ /^Vxlan\d+/
57
+ fail 'value #{value.inspect} is invalid, must be a valid ' \
58
+ 'Vxlan interface name'
59
+ end
60
+ end
61
+ end
62
+
63
+ # Properties (state management)
64
+
65
+ newproperty(:description) do
66
+ desc <<-EOS
67
+ The one line description to configure for the interface. The
68
+ description can be any valid alphanumeric string including symbols
69
+ and spaces.
70
+
71
+ The default value for description is ''
72
+ EOS
73
+
74
+ validate do |value|
75
+ case value
76
+ when String then super(value)
77
+ else fail "value #{value.inspect} is invalid, must be a String."
78
+ end
79
+ end
80
+ end
81
+
82
+ newproperty(:enable) do
83
+ desc <<-EOS
84
+ The enable value configures the administrative state of the
85
+ specified interface. Valid values for enable are:
86
+
87
+ * true - Administratively enables the interface
88
+ * false - Administratively disables the interface
89
+
90
+ The default value for enable is :true
91
+ EOS
92
+ newvalues(:true, :false)
93
+ end
94
+
95
+ newproperty(:source_interface) do
96
+ desc <<-EOS
97
+ The source interface property specifies the interface address
98
+ to use to source Vxlan packets from. This value configures
99
+ the vxlan source-interface value in EOS
100
+
101
+ The default value for source_interface is ''
102
+ EOS
103
+
104
+ validate do |value|
105
+ case value
106
+ when String then super(resource)
107
+ else fail "value #{value.inspect} is invalid, must be a String."
108
+ end
109
+ end
110
+ end
111
+
112
+ newproperty(:multicast_group) do
113
+ desc <<-EOS
114
+ The multicast group property specifies the multicast group
115
+ address to use for VTEP communication. This value configures
116
+ the vxlan multicast-group value in EOS. The configured value
117
+ must be a valid multicast address in the range of 224/8.
118
+
119
+ The default value for multicast_group is ''
120
+ EOS
121
+
122
+ MCAST_REGEXP = /^2(?:2[4-9]|3\d)
123
+ (?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d?|0)){3}$/x
124
+
125
+ validate do |value|
126
+ unless value =~ MCAST_REGEXP
127
+ fail "value #{value.inspect} is invalid, must a multicast address"
128
+ end
129
+ end
130
+ end
131
+
132
+ newproperty(:udp_port) do
133
+ desc <<-EOS
134
+ The udp_port property specifies the VXLAN UDP port associated
135
+ with sending and receiveing VXLAN traffic. This value configures
136
+ the vxlan udp-port value in EOS. The configured value must be
137
+ an integer in the range of 1024 to 65535.
138
+
139
+ The default value for the udp_port setting is 4789
140
+ EOS
141
+
142
+ munge { |value| Integer(value) }
143
+
144
+ validate do |value|
145
+ unless value.to_i.between?(1024, 65_535)
146
+ fail "value #{value.inspect} must be between 1024 and 65535"
147
+ end
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,78 @@
1
+ #
2
+ # Copyright (c) 2014, Arista Networks, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # Redistributions of source code must retain the above copyright notice,
10
+ # this list of conditions and the following disclaimer.
11
+ #
12
+ # Redistributions in binary form must reproduce the above copyright
13
+ # notice, this list of conditions and the following disclaimer in the
14
+ # documentation and/or other materials provided with the distribution.
15
+ #
16
+ # Neither the name of Arista Networks nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARISTA NETWORKS
24
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ #
32
+ # encoding: utf-8
33
+
34
+ Puppet::Type.newtype(:eos_vxlan_vlan) do
35
+ @doc = <<-EOS
36
+ This type manages the VXLAN VLAN to VNI mappings in the nodes
37
+ current running configuration. It provides a resources for
38
+ ensuring specific mappings are present or absent
39
+ EOS
40
+
41
+ ensurable
42
+
43
+ # Parameters
44
+
45
+ newparam(:name, namevar: true) do
46
+ desc <<-EOS
47
+ The VLAN ID that is associated with this mapping in the valid
48
+ VLAN ID range of 1 to 4094. The VLAN ID is configured on the
49
+ VXLAN VTI with a one-to-one mapping to VNI.
50
+ EOS
51
+
52
+ munge { |value| Integer(value).to_s }
53
+
54
+ validate do |value|
55
+ unless value.to_i.between?(1, 4_094)
56
+ fail "value #{value.inspect} is not between 1 and 4094"
57
+ end
58
+ end
59
+ end
60
+
61
+ # Properties (state management)
62
+
63
+ newproperty(:vni) do
64
+ desc <<-EOS
65
+ The VNI associate with the VLAN ID mapping on the VXLAN VTI
66
+ interface. The VNI value is an integer value in the range
67
+ of 1 to 16777215.
68
+ EOS
69
+
70
+ munge { |value| Integer(value).to_s }
71
+
72
+ validate do |value|
73
+ unless value.to_i.between?(1, 16_777_215)
74
+ fail "value #{value.inspect} is not between 1 and 16777215"
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,62 @@
1
+ #
2
+ # Copyright (c) 2015, Arista Networks, Inc.
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # Redistributions of source code must retain the above copyright notice,
10
+ # this list of conditions and the following disclaimer.
11
+ #
12
+ # Redistributions in binary form must reproduce the above copyright
13
+ # notice, this list of conditions and the following disclaimer in the
14
+ # documentation and/or other materials provided with the distribution.
15
+ #
16
+ # Neither the name of Arista Networks nor the names of its
17
+ # contributors may be used to endorse or promote products derived from
18
+ # this software without specific prior written permission.
19
+ #
20
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARISTA NETWORKS
24
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ #
32
+ # encoding: utf-8
33
+
34
+ Puppet::Type.newtype(:eos_vxlan_vtep) do
35
+ @doc = <<-EOS
36
+ This type provides management of the global Vxlan VTEP flood list.
37
+ EOS
38
+
39
+ ensurable
40
+
41
+ # Parameters
42
+
43
+ newparam(:name, namevar: true) do
44
+ desc <<-EOS
45
+ The name property associates the IPv4 flood address on the specified
46
+ VXLAN VNI interface. The address value is configured using
47
+ address format.
48
+
49
+ For example
50
+
51
+ name => 192.168.10.16
52
+ EOS
53
+
54
+ validate do |value|
55
+ begin
56
+ IPAddr.new value
57
+ rescue ArgumentError => exc
58
+ raise "value #{value.inspect} is invalid, #{exc.message}"
59
+ end
60
+ end
61
+ end
62
+ end