From 037a6d497ba8c9a8025c7bff481e76c87a34b6bb Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sat, 29 Jun 2013 19:59:14 -0400 Subject: [PATCH] moved modules to net_infrastructure --- .../arista_interface | 37 ++++++++------- .../arista_l2interface | 47 +++++++++++++------ .../arista_lag | 41 ++++++++++------ .../arista_vlan | 36 ++++++++------ 4 files changed, 103 insertions(+), 58 deletions(-) rename library/{network => net_infrastructure}/arista_interface (89%) rename library/{network => net_infrastructure}/arista_l2interface (88%) rename library/{network => net_infrastructure}/arista_lag (90%) rename library/{network => net_infrastructure}/arista_vlan (93%) diff --git a/library/network/arista_interface b/library/net_infrastructure/arista_interface similarity index 89% rename from library/network/arista_interface rename to library/net_infrastructure/arista_interface index 77d0a71b08..c5ab653bb8 100644 --- a/library/network/arista_interface +++ b/library/net_infrastructure/arista_interface @@ -31,53 +31,58 @@ options: description: - the full name of the interface required: true - default: null - aliases: [] logging: description: - enables or disables the syslog facility for this module required: false default: false choices: [ 'true', 'false', 'yes', 'no' ] - aliases: [] admin: description: - controls the operational state of the interface required: false - default: null choices: [ 'up', 'down' ] - aliases: [] description: description: - a single line text string describing the interface required: false - default: null - aliases: [] mtu: description: - configureds the maximum transmission unit for the interface required: false default: 1500 - aliases: [] speed: description: - sets the interface speed setting required: false default: 'auto' choices: [ 'auto', '100m', '1g', '10g' ] - aliases: [] duplex: description: - sets the interface duplex setting required: false default: 'auto' choices: [ 'auto', 'half', 'full' ] - aliases: [] -examples: - - code: 'arista_interface: interface_id=Ethernet1 admin="up"' - description: "Administratively enable the Ethernet1 interface" - - code: 'arista_interface: itnerface_id=Ethernet4 state="default"' - descripton: "Default interface Ethernet4" +notes: + - Requires EOS 4.10 or later + - The Netdev extension for EOS must be installed and active in the + available extensions (show extensions from the EOS CLI) + - See http://eos.aristanetworks.com for details +''' +EXAMPLES = ''' +Example playbook entries using the arista_interface module to manage resource +state. Note that interface names must be the full interface name not shortcut +names (ie Ethernet, not Et1) + + tasks: + - name: enable interface Ethernet 1 + action: arista_interface interface_id=Ethernet1 admin=up speed=10g duplex=full logging=true + + - name: set mtu on Ethernet 1 + action: arista_interface interface_id=Ethernet1 mtu=1600 speed=10g duplex=full logging=true + + - name: reset changes to Ethernet 1 + action: arista_interface interface_id=Ethernet1 admin=down mtu=1500 speed=10g duplex=full logging=true ''' import syslog import json @@ -220,7 +225,7 @@ def main(): mtu=dict(default=None, type='int'), speed=dict(default=None, choices=['auto', '100m', '1g', '10g']), duplex=dict(default=None, choices=['auto', 'half', 'full']), - logging=dict(default=False, choices=BOOLEANS) + logging=dict(default=False, type='bool') ), supports_check_mode = True ) diff --git a/library/network/arista_l2interface b/library/net_infrastructure/arista_l2interface similarity index 88% rename from library/network/arista_l2interface rename to library/net_infrastructure/arista_l2interface index 64ce8b0d2a..fa33aff3bc 100644 --- a/library/network/arista_l2interface +++ b/library/net_infrastructure/arista_l2interface @@ -31,22 +31,18 @@ options: description: - the full name of the interface required: true - default: null - aliases: [] state: description: - describe the desired state of the interface related to the config required: false default: 'present' choices: [ 'present', 'absent' ] - aliases: [] logging: description: - enables or disables the syslog facility for this module required: false default: false choices: [ 'true', 'false', 'yes', 'no' ] - aliases: [] vlan_tagging: description: - specifies whether or not vlan tagging should be enabled for @@ -54,26 +50,49 @@ options: required: false default: true choices: [ 'enable', 'disable' ] - aliases: [] tagged_vlans: description: - specifies the list of vlans that should be allowed to transit this interface required: false - default: null - aliases: [] untagged_vlan: description: - specifies the vlan that untagged traffic should be placed in for transit across a vlan tagged link required: false default: 'default' - aliases: [] -examples: - - code: 'arista_l2interface: interface_id=Ethernet1 vlan_tagging="enable"' - description: "Enable vlan tagging for interface Ethernet1" - - code: 'arista_l2interface: interface_id=Ethernet4 tagged_vlans=Blue,Red' - descripton: "Specifies vlans Blue & Red should be allowed across this interface" +notes: + - Requires EOS 4.10 or later + - The Netdev extension for EOS must be installed and active in the + available extensions (show extensions from the EOS CLI) + - See http://eos.aristanetworks.com for details +''' +EXAMPLES = ''' +Example playbook entries using the arista_l2interface module to manage resource +state. Note that interface names must be the full interface name not shortcut +names (ie Ethernet, not Et1) + + tasks: + - name: create switchport ethernet1 access port + action: arista_l2interface interface_id=Ethernet1 logging=true + + - name: create switchport ethernet2 trunk port + action: arista_l2interface interface_id=Ethernet2 vlan_tagging=enable logging=true + + - name: add vlans to red and blue switchport ethernet2 + action: arista_l2interface interface_id=Ethernet2 tagged_vlans=red,blue logging=true + + - name: set untagged vlan for Ethernet1 + action: arista_l2interface interface_id=Ethernet1 untagged_vlan=red logging=true + + - name: convert access to trunk + action: arista_l2interface interface_id=Ethernet1 vlan_tagging=enable tagged_vlans=red,blue logging=true + + - name: convert trunk to access + action: arista_l2interface interface_id=Ethernet2 vlan_tagging=disable untagged_vlan=blue logging=true + + - name: delete switchport ethernet1 + action: arista_l2interface interface_id=Ethernet1 state=absent logging=true ''' import syslog import json @@ -270,7 +289,7 @@ def main(): vlan_tagging=dict(default=None, choices=['enable', 'disable']), tagged_vlans=dict(default=None, type='str'), untagged_vlan=dict(default=None, type='str'), - logging=dict(default=False, choices=BOOLEANS) + logging=dict(default=False, type='bool') ), supports_check_mode = True ) diff --git a/library/network/arista_lag b/library/net_infrastructure/arista_lag similarity index 90% rename from library/network/arista_lag rename to library/net_infrastructure/arista_lag index 2523215f61..c96d0dee58 100644 --- a/library/network/arista_lag +++ b/library/net_infrastructure/arista_lag @@ -25,50 +25,63 @@ requirements: - Arista EOS 4.10 - Netdev extension for EOS description: - - Manage port channel (lag) interfaceresources on Arista EOS network devices + - Manage port channel interface resources on Arista EOS network + devices options: interface_id: description: - the full name of the interface required: true - default: null - aliases: [] state: description: - describe the desired state of the interface related to the config required: false default: 'present' choices: [ 'present', 'absent' ] - aliases: [] logging: description: - enables or disables the syslog facility for this module required: false default: false choices: [ 'true', 'false', 'yes', 'no' ] - aliases: [] links: description: - array of physical interface links to include in this lag required: false - default: null - aliases: [] minimum_links: description: - the minimum number of physical interaces that must be operationally up to consider the lag operationally up required: false - default: null - aliases: [] lacp: description: - enables the use of the LACP protocol for managing link bundles required: false default: 'active', choices: [ 'active', 'passive', 'off' ] - aliases: [] -examples: - - code: 'arista_lag: interface_id=Port-Channel10 links=Ethernet1,Ethernet2' - description: "Configure Port-Channel 10 with physical interfaces Ethernet1 and Ethernet2 as members" +notes: + - Requires EOS 4.10 or later + - The Netdev extension for EOS must be installed and active in the + available extensions (show extensions from the EOS CLI) + - See http://eos.aristanetworks.com for details +''' + +EXAMPLES = ''' +Example playbook entries using the arista_lag module to manage resource +state. Note that interface names must be the full interface name not shortcut +names (ie Ethernet, not Et1) + + tasks: + - name: create lag interface + action: arista_lag interface_id=Port-Channel1 links=Ethernet1,Ethernet2 logging=true + + - name: add member links + action: arista_lag interface_id=Port-Channel1 links=Ethernet1,Ethernet2,Ethernet3 logging=true + + - name: remove member links + action: arista_lag interface_id=Port-Channel1 links=Ethernet2,Ethernet3 logging=true + + - name: remove lag interface + action: arista_lag interface_id=Port-Channel1 state=absent logging=true ''' import syslog import json @@ -265,7 +278,7 @@ def main(): links=dict(default=None, type='str'), lacp=dict(default=None, choices=['active', 'passive', 'off'], type='str'), minimum_links=dict(default=None, type='int'), - logging=dict(default=False, choices=BOOLEANS) + logging=dict(default=False, type='bool') ), supports_check_mode = True ) diff --git a/library/network/arista_vlan b/library/net_infrastructure/arista_vlan similarity index 93% rename from library/network/arista_vlan rename to library/net_infrastructure/arista_vlan index 9c64cded02..14d429a0af 100644 --- a/library/network/arista_vlan +++ b/library/net_infrastructure/arista_vlan @@ -25,43 +25,51 @@ requirements: - Arista EOS 4.10 - Netdev extension for EOS description: - - Manage VLAN resources on Arista EOS network devices + - Manage VLAN resources on Arista EOS network devices. This module + requires the Netdev EOS extension to be installed in EOS. For detailed + instructions for installing and using the Netdev module please see + [link] options: vlan_id: description: - the vlan id required: true - default: null - aliases: [] state: description: - describe the desired state of the vlan related to the config required: false default: 'present' choices: [ 'present', 'absent' ] - aliases: [] logging: description: - enables or disables the syslog facility for this module required: false - default: false choices: [ 'true', 'false', 'yes', 'no' ] - aliases: [] name: description: - a descriptive name for the vlan required: false - default: null - aliases: [] -examples: - - code: 'arista_vlan: vlan_id=100 name="Blue"' - description: "Creates vlan 100 in the running config" - - code: 'arista_vlan: vlan_id=200 state="absent"' - descripton: "Ensures vlan 200 is not in the config" notes: - Requires EOS 4.10 or later - The Netdev extension for EOS must be installed and active in the available extensions (show extensions from the EOS CLI) + - See http://eos.aristanetworks.com for details +''' + +EXAMPLES = ''' +Example playbook entries using the arista_vlan module to manage resource +state. + + tasks: + - name: create vlan 999 + action: arista_vlan vlan_id=999 logging=true + + - name: create / edit vlan 999 + action: arista_vlan vlan_id=999 name=test logging=true + + - name: remove vlan 999 + action: arista_vlan vlan_id=999 state=absent logging=true + ''' import syslog import json @@ -251,7 +259,7 @@ def main(): vlan_id=dict(default=None, required=True, type='int'), name=dict(default=None, type='str'), state=dict(default='present', choices=['present', 'absent']), - logging=dict(default=False, choices=BOOLEANS) + logging=dict(default=False, type='bool') ), supports_check_mode = True )