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.
- 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
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
require 'puppet_x/eos/utils/helpers'
|
|
34
|
+
|
|
35
|
+
Puppet::Type.newtype(:eos_ipinterface) do
|
|
36
|
+
@doc = <<-EOS
|
|
37
|
+
This type provides management of logical IP interfaces configured
|
|
38
|
+
in EOS. It provides configuration of IPv4 properties on physical
|
|
39
|
+
interfaces and logical virtual interfaces.
|
|
40
|
+
EOS
|
|
41
|
+
|
|
42
|
+
ensurable
|
|
43
|
+
|
|
44
|
+
# Parameters
|
|
45
|
+
|
|
46
|
+
newparam(:name) do
|
|
47
|
+
desc <<-EOS
|
|
48
|
+
The name parameter specifies the full interface identifier of
|
|
49
|
+
the Arista EOS interface to manage. This value must correspond
|
|
50
|
+
to a valid interface identifier in EOS.
|
|
51
|
+
EOS
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Properties (state management)
|
|
55
|
+
|
|
56
|
+
newproperty(:address) do
|
|
57
|
+
desc <<-EOS
|
|
58
|
+
The address property configures the IPv4 address on the
|
|
59
|
+
specified interface. The address value is configured using
|
|
60
|
+
address/mask format.
|
|
61
|
+
|
|
62
|
+
For example
|
|
63
|
+
|
|
64
|
+
address => 192.168.10.16/24
|
|
65
|
+
EOS
|
|
66
|
+
|
|
67
|
+
validate do |value|
|
|
68
|
+
begin
|
|
69
|
+
IPAddr.new value
|
|
70
|
+
rescue ArgumentError => exc
|
|
71
|
+
raise "value #{value.inspect} is invalid, #{exc.message}"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
newproperty(:helper_addresses, array_matching: :all) do
|
|
77
|
+
desc <<-EOS
|
|
78
|
+
The helper_addresses property configures the list of IP
|
|
79
|
+
helper addresses on the specified interface. IP helper
|
|
80
|
+
addresses configure a list of forwarding address to send
|
|
81
|
+
send broadcast traffic to as unicast, typically used to
|
|
82
|
+
assist DHCP relay.
|
|
83
|
+
|
|
84
|
+
Helper addresses are configured using dotted decimal
|
|
85
|
+
notation. For example
|
|
86
|
+
|
|
87
|
+
helper_addresses => ['192.168.10.254', '192.168.11.254']
|
|
88
|
+
EOS
|
|
89
|
+
|
|
90
|
+
validate do |value|
|
|
91
|
+
unless value =~ IPADDR_REGEXP
|
|
92
|
+
fail "value #{value.inspect} is invalid, must be an IP address"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
newproperty(:mtu) do
|
|
98
|
+
desc <<-EOS
|
|
99
|
+
The mtu property configures the IP interface MTU value
|
|
100
|
+
which specifies the largest IP datagram that can pass
|
|
101
|
+
over the interface without fragementation. The MTU value
|
|
102
|
+
is specified in bytes and accepts an integer in the range of
|
|
103
|
+
68 to 9214.
|
|
104
|
+
EOS
|
|
105
|
+
|
|
106
|
+
munge do |value|
|
|
107
|
+
Integer(value)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
validate do |value|
|
|
111
|
+
unless value.to_i.between?(68, 9214)
|
|
112
|
+
fail "value #{value.inspect} must be in the range of 68 and 9214"
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
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_mlag) do
|
|
37
|
+
@doc = <<-EOS
|
|
38
|
+
This type manages the global MLAG instance on EOS nodes. It
|
|
39
|
+
provides configuration for global MLAG configuration parameters.
|
|
40
|
+
EOS
|
|
41
|
+
|
|
42
|
+
# Parameters
|
|
43
|
+
|
|
44
|
+
newparam(:name) do
|
|
45
|
+
desc <<-EOS
|
|
46
|
+
The name parameter identifies the global MLAG instance for
|
|
47
|
+
configuration and should be configured as 'settings'. All
|
|
48
|
+
other values for name will be siliently ignored by the eos_mlag
|
|
49
|
+
provider.
|
|
50
|
+
EOS
|
|
51
|
+
isnamevar
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Properties (state management)
|
|
55
|
+
|
|
56
|
+
newproperty(:domain_id) do
|
|
57
|
+
desc <<-EOS
|
|
58
|
+
The domain_id property configures the MLAG domain-id value for
|
|
59
|
+
the global MLAG configuration instance. The domain-id setting
|
|
60
|
+
identifies the domain name for the MLAG domain. Valid values
|
|
61
|
+
include alphanumeric characters
|
|
62
|
+
EOS
|
|
63
|
+
|
|
64
|
+
validate do |value|
|
|
65
|
+
case value
|
|
66
|
+
when String then super(value)
|
|
67
|
+
else fail "value #{value.inspect} is invalid, must be a string."
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
newproperty(:local_interface) do
|
|
73
|
+
desc <<-EOS
|
|
74
|
+
The local_interface property configures the MLAG local-interface
|
|
75
|
+
value for the global MLAG configuration instance. The local-interface
|
|
76
|
+
setting specifies the VLAN SVI to send MLAG control traffic on.
|
|
77
|
+
|
|
78
|
+
Valid values must be a VLAN SVI identifier
|
|
79
|
+
EOS
|
|
80
|
+
|
|
81
|
+
validate do |value|
|
|
82
|
+
unless value =~ /^Vlan\d+$/
|
|
83
|
+
fail "value #{value.inspect} is invalid, must be a VLAN SVI"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
newproperty(:peer_address) do
|
|
89
|
+
desc <<-EOS
|
|
90
|
+
The peer_address property configures the MLAG peer-address value
|
|
91
|
+
for the global MLAG configuration instance. The peer-address setting
|
|
92
|
+
specifieds the MLAG peer control endpoint IP address.
|
|
93
|
+
|
|
94
|
+
The specified value must be a valid IP address
|
|
95
|
+
EOS
|
|
96
|
+
|
|
97
|
+
validate do |value|
|
|
98
|
+
unless value =~ IPADDR_REGEXP
|
|
99
|
+
fail "value #{value.inspect} is invalid, must be an IP address"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
newproperty(:peer_link) do
|
|
105
|
+
desc <<-EOS
|
|
106
|
+
The peer_link property configures the MLAG peer-link value for the
|
|
107
|
+
glboal MLAG configuration instance. The peer-link setting specifies
|
|
108
|
+
the interface used to communicate control traffic to the MLAG peer
|
|
109
|
+
|
|
110
|
+
The provided value must be a valid Ethernet or Port-Channel interface
|
|
111
|
+
identifer
|
|
112
|
+
EOS
|
|
113
|
+
|
|
114
|
+
validate do |value|
|
|
115
|
+
unless value =~ /^[Et|Po].+/
|
|
116
|
+
fail "value #{value.inspect} is invalid, must be a valid " \
|
|
117
|
+
'Ethernet or Port-Channel interface identifier'
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
newproperty(:enable) do
|
|
123
|
+
desc <<-EOS
|
|
124
|
+
The enable property configures the admininstrative state of the
|
|
125
|
+
global MLAG configuration. Valid values for enable are:
|
|
126
|
+
|
|
127
|
+
* true - globally enables the MLAG configuration
|
|
128
|
+
* false - glboally disables the MLAG configuration
|
|
129
|
+
EOS
|
|
130
|
+
|
|
131
|
+
newvalues(:true, :false)
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
|
|
33
|
+
Puppet::Type.newtype(:eos_mlag_interface) do
|
|
34
|
+
@doc = <<-EOS
|
|
35
|
+
This type manages MLAG interfaces on the node used to establish
|
|
36
|
+
a valid MLAG with a peer switch. The mlag_id parameter is required
|
|
37
|
+
for this type.
|
|
38
|
+
EOS
|
|
39
|
+
|
|
40
|
+
ensurable
|
|
41
|
+
|
|
42
|
+
# Parameters
|
|
43
|
+
|
|
44
|
+
newparam(:name) do
|
|
45
|
+
desc <<-EOS
|
|
46
|
+
The name property identifies the interface to be present
|
|
47
|
+
or absent from the MLAG interface list. The interface must
|
|
48
|
+
be of type portchannel.
|
|
49
|
+
|
|
50
|
+
This property expectes the full interface identifier
|
|
51
|
+
EOS
|
|
52
|
+
|
|
53
|
+
validate do |value|
|
|
54
|
+
unless value =~ /^Port-Channel/
|
|
55
|
+
fail "value #{value.inspect} is invalid, must be a Port-Channel"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Properties (state management)
|
|
61
|
+
|
|
62
|
+
newproperty(:mlag_id) do
|
|
63
|
+
desc <<-EOS
|
|
64
|
+
The mlag_id property assigns a MLAG ID to a Port-Channel interface
|
|
65
|
+
used for forming a MLAG with a peer switch. Only one MLAG ID can
|
|
66
|
+
be associated with an interface.
|
|
67
|
+
|
|
68
|
+
Valid values are in the range of 1 to 2000
|
|
69
|
+
|
|
70
|
+
**Note**
|
|
71
|
+
Changing this value on an operational link will cause traffic
|
|
72
|
+
distruption
|
|
73
|
+
EOS
|
|
74
|
+
|
|
75
|
+
munge do |value|
|
|
76
|
+
Integer(value).to_i
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
validate do |value|
|
|
80
|
+
unless value.to_i.between?(1, 2_000)
|
|
81
|
+
fail "value #{value.inspect} is not between 1 and 2000"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
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_ntp_config) do
|
|
35
|
+
@doc = <<-EOS
|
|
36
|
+
This type manages the nodes global NTP configuration settings.
|
|
37
|
+
It provides a configuration resource for setting global NTP
|
|
38
|
+
values
|
|
39
|
+
EOS
|
|
40
|
+
|
|
41
|
+
# Parameters
|
|
42
|
+
|
|
43
|
+
newparam(:name) do
|
|
44
|
+
desc <<-EOS
|
|
45
|
+
The name parameter identifies the global NTP instance for
|
|
46
|
+
configuration and should be configured as 'settings'. All
|
|
47
|
+
other values for name will be siliently ignored by the provider.
|
|
48
|
+
EOS
|
|
49
|
+
isnamevar
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Properties (state management)
|
|
53
|
+
#
|
|
54
|
+
newproperty(:source_interface) do
|
|
55
|
+
desc <<-EOS
|
|
56
|
+
The source interface property provides configuration management
|
|
57
|
+
of the NTP source-interface value. The source interface value
|
|
58
|
+
configures the interface address to use as the source address
|
|
59
|
+
when sending NTP packets on the network.
|
|
60
|
+
|
|
61
|
+
The default value for source_interface is ''
|
|
62
|
+
EOS
|
|
63
|
+
|
|
64
|
+
validate do |value|
|
|
65
|
+
unless value =~ /^[EMPLV]/
|
|
66
|
+
fail "value #{value.inspect} is invalid, must be an interface name"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
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_ntp_server) do
|
|
34
|
+
@doc = <<-EOS
|
|
35
|
+
This type manages the list of NTP servers. It provides a
|
|
36
|
+
configuration resource for managing the list of NTP servers
|
|
37
|
+
used by the node.
|
|
38
|
+
EOS
|
|
39
|
+
|
|
40
|
+
ensurable
|
|
41
|
+
|
|
42
|
+
# Parameters
|
|
43
|
+
|
|
44
|
+
newparam(:name) do
|
|
45
|
+
desc <<-EOS
|
|
46
|
+
The name parameter configures the NTP server list by
|
|
47
|
+
adding or removing NTP server entries. The value can be
|
|
48
|
+
configured as either the host IP address or the fully qualified
|
|
49
|
+
domain name of the desired NTP server.
|
|
50
|
+
EOS
|
|
51
|
+
end
|
|
52
|
+
end
|