NXOS Docs update

This commit is contained in:
John Barker 2016-08-05 13:01:13 +01:00 committed by Matt Clay
parent 2ea29fee3f
commit 3f8f67e359
14 changed files with 104 additions and 78 deletions

View file

@ -23,8 +23,8 @@ version_added: "2.1"
author: "Peter Sprygada (@privateip)"
short_description: Run arbitrary command on Cisco NXOS devices
description:
- Sends an aribtrary command to an NXOS node and returns the results
read from the device. The M(nxos_command) modulule includes an
- Sends an arbitrary command to an NXOS node and returns the results
read from the device. This module includes an
argument that will cause the module to wait for a specific condition
before returning or timing out if the condition is not met.
extends_documentation_fragment: nxos
@ -50,8 +50,8 @@ options:
description:
- Specifies the number of retries a command should by tried
before it is considered failed. The command is run on the
target device every retry and evaluated against the waitfor
conditionals
target device every retry and evaluated against the I(waitfor)
conditionals.
required: false
default: 10
interval:

View file

@ -23,8 +23,8 @@ version_added: "2.1"
author: "Peter Sprygada (@privateip)"
short_description: Manage Cisco NXOS configuration sections
description:
- Cisco NXOS configurations use a simple block indent file sytanx
for segementing configuration into sections. This module provides
- Cisco NXOS configurations use a simple block indent file syntax
for segmenting configuration into sections. This module provides
an implementation for working with NXOS configuration sections in
a deterministic way. This module works with either CLI or NXAPI
transports.
@ -52,7 +52,7 @@ options:
a change needs to be made. This allows the playbook designer
the opportunity to perform configuration commands prior to pushing
any changes without affecting how the set of commands are matched
against the system
against the system.
required: false
default: null
after:
@ -81,7 +81,7 @@ options:
the modified lines are pushed to the device in configuration
mode. If the replace argument is set to I(block) then the entire
command block is pushed to the device in configuration mode if any
line is not correct
line is not correct.
required: false
default: line
choices: ['line', 'block']
@ -101,8 +101,8 @@ options:
against the contents of source. There are times when it is not
desirable to have the task get the current running-config for
every task in a playbook. The I(config) argument allows the
implementer to pass in the configuruation to use as the base
config for comparision.
implementer to pass in the configuration to use as the base
config for comparison.
required: false
default: null
"""

View file

@ -24,7 +24,9 @@ short_description: Gets facts about NX-OS switches
description:
- Offers ability to extract facts from device
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
'''
EXAMPLES = '''

View file

@ -24,15 +24,17 @@ short_description: Manage features in NX-OS switches
description:
- Offers ability to enable and disable features in NX-OS
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
options:
feature:
description:
- Name of feature
- Name of feature.
required: true
state:
description:
- Desired state of the feature
- Desired state of the feature.
required: false
default: 'enabled'
choices: ['enabled','disabled']
@ -89,7 +91,7 @@ feature:
def execute_config_command(commands, module):
try:
module.configure(commands)
except ShellError:
except ShellError:
clie = get_exception()
module.fail_json(msg='Error sending CLI commands',
error=str(clie), commands=commands)

View file

@ -39,24 +39,24 @@ options:
default: null
admin_state:
description:
- Administrative state of the interface
- Administrative state of the interface.
required: false
default: up
choices: ['up','down']
description:
description:
- Interface description
- Interface description.
required: false
default: null
mode:
description:
- Manage Layer 2 or Layer 3 state of the interface
- Manage I(Layer2) or I(Layer3) state of the interface.
required: false
default: null
choices: ['layer2','layer3']
state:
description:
- Specify desired state of the resource
- Specify desired state of the resource.
required: true
default: present
choices: ['present','absent','default']

View file

@ -24,7 +24,9 @@ short_description: Manages L3 attributes for IPv4 and IPv6 interfaces
description:
- Manages Layer 3 attributes for IPv4 and IPv6 interfaces
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- Interface must already be a L3 port when using this module
- Logical interfaces (po, loop, svi) must be created first
@ -35,21 +37,21 @@ notes:
options:
interface:
description:
- Full name of interface, i.e. Ethernet1/1, vlan10
- Full name of interface, i.e. Ethernet1/1, vlan10.
required: true
addr:
description:
- IPv4 or IPv6 Address
- IPv4 or IPv6 Address.
required: false
default: null
mask:
description:
- Subnet mask for IPv4 or IPv6 Address in decimal format
- Subnet mask for IPv4 or IPv6 Address in decimal format.
required: false
default: null
state:
description:
- Specify desired state of the resource
- Specify desired state of the resource.
required: false
default: present
choices: ['present','absent']

View file

@ -39,7 +39,7 @@ options:
choices:
- started
- stopped
requred: false
required: false
default: started
http_port:
description:
@ -56,12 +56,18 @@ options:
- Enable/disable HTTP server.
required: false
default: true
choices:
- true
- false
aliases:
- enable_http
https:
description:
- Enable/disable HTTPS server.
required: false
choices:
- true
- false
default: true
aliases:
- enable_https
@ -70,6 +76,9 @@ options:
- Enable/disable NXAPI web based UI for entering commands.
required: false
default: true
choices:
- true
- false
aliases:
- enable_sandbox
"""
@ -144,6 +153,7 @@ def execute_commands(module, commands):
if not module.params.get('check_mode'):
module.configure(commands)
def get_nxapi_state(module):
features = module.execute(['show feature | grep nxapi'])[0]
if re.search('disabled', features) is None:
@ -231,7 +241,7 @@ def main():
"""
argument_spec = dict(
state=dict(default='started', choices=['started','stopped']),
state=dict(default='started', choices=['started', 'stopped']),
http_port=dict(default=80, type='int'),
https_port=dict(default=443, type='int'),
http=dict(aliases=['enable_http'], default=True, type='bool'),

View file

@ -22,27 +22,29 @@ module: nxos_ping
version_added: "2.1"
short_description: Tests reachability using ping from Nexus switch
description:
- Tests reachability using ping from switch to a remote destination
- Tests reachability using ping from switch to a remote destination.
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
options:
dest:
description:
- IP address or hostname (resolvable by switch) of remote node
- IP address or hostname (resolvable by switch) of remote node.
required: true
count:
description:
- Number of packets to send
- Number of packets to send.
required: false
default: 2
source:
description:
- Source IP Address
- Source IP Address.
required: false
default: null
vrf:
description:
- Outgoing VRF
- Outgoing VRF.
required: false
default: null
'''

View file

@ -27,40 +27,40 @@ description:
- Manages Layer 2 interfaces
author: Jason Edelman (@jedelman8)
notes:
- When state=absent, vlans can be added/removed from trunk links and
the existing access vlan can be 'unconfigured' to just having VLAN 1
- When C(state=absent), VLANs can be added/removed from trunk links and
the existing access VLAN can be 'unconfigured' to just having VLAN 1
on that interface
- When working with trunks VLANs the keywords add/remove are always sent
in the `switchport trunk allowed vlan` command. Use verbose mode to see
commands sent.
- When state=unconfigured, the interface will result with having a default
- When C(state=unconfigured), the interface will result with having a default
Layer 2 interface, i.e. vlan 1 in access mode
options:
interface:
description:
- Full name of the interface, i.e. Ethernet1/1
- Full name of the interface, i.e. Ethernet1/1.
required: true
default: null
mode:
description:
- Mode for the Layer 2 port
- Mode for the Layer 2 port.
required: false
default: null
choices: ['access','trunk']
access_vlan:
description:
- if mode=access, used as the access vlan id
- If C(mode=access), used as the access VLAN ID.
required: false
default: null
native_vlan:
description:
- if mode=trunk, used as the trunk native vlan id
- If C(mode=trunk), used as the trunk native VLAN ID.
required: false
default: null
trunk_vlans:
description:
- if mode=trunk, used as the vlan range to ADD or REMOVE
from the trunk
- If C(mode=trunk), used as the VLAN range to ADD or REMOVE
from the trunk.
required: false
default: null
state:

View file

@ -23,9 +23,9 @@ author: "Peter Sprygada (@privateip)"
short_description: Manage Cisco NXOS device configurations
description:
- Manages network device configurations over SSH or NXAPI. This module
allows implementors to work with the device running-config. It
allows implementers to work with the device running-config. It
provides a way to push a set of commands onto a network device
by evaluting the current running-config and only pushing configuration
by evaluating the current running-config and only pushing configuration
commands that are not already configured. The config source can
be a set of commands or a template.
extends_documentation_fragment: nxos
@ -50,9 +50,9 @@ options:
include_defaults:
description:
- The module, by default, will collect the current device
running-config to use as a base for comparision to the commands
running-config to use as a base for comparisons to the commands
in I(src). Setting this value to true will cause the module
to issue the command `show running-config all` to include all
to issue the command C(show running-config all) to include all
device settings.
required: false
default: false
@ -73,8 +73,8 @@ options:
against the contents of source. There are times when it is not
desirable to have the task get the current running-config for
every task in a playbook. The I(config) argument allows the
implementer to pass in the configuruation to use as the base
config for comparision.
implementer to pass in the configuration to use as the base
config for comparison.
required: false
default: null
"""
@ -109,12 +109,14 @@ responses:
sample: ['...', '...']
"""
def get_config(module):
config = module.params['config'] or dict()
if not config and not module.params['force']:
config = module.config
return config
def main():
argument_spec = dict(

View file

@ -28,36 +28,36 @@ extends_documentation_fragment: nxos
options:
vlan_id:
description:
- single vlan id
- Single VLAN ID.
required: false
default: null
vlan_range:
description:
- range of VLANs such as 2-10 or 2,5,10-15, etc.
- A range of VLANs such as I(2-10) or I(2,5,10-15) etc.
required: false
default: null
name:
description:
- name of VLAN
- The name of VLAN.
required: false
default: null
vlan_state:
description:
- Manage the vlan operational state of the VLAN
(equivalent to state {active | suspend} command
- Manage the VLAN operational state of the VLAN
(equivalent to state {active | suspend} command.
required: false
default: active
choices: ['active','suspend']
admin_state:
description:
- Manage the vlan admin state of the VLAN equivalent
to shut/no shut in vlan config mode
- Manage the VLAN admin state of the VLAN equivalent
to shut/no shut in VLAN config mode.
required: false
default: up
choices: ['up','down']
state:
description:
- Manage the state of the resource
- Manage the state of the resource.
required: false
default: present
choices: ['present','absent']

View file

@ -24,7 +24,9 @@ short_description: Manages global VRF configuration
description:
- Manages global VRF configuration
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- Cisco NX-OS creates the default VRF by itself. Therefore,
you're not allowed to use default as I(vrf) name in this module.
@ -37,17 +39,17 @@ notes:
options:
vrf:
description:
- Name of VRF to be managed
- Name of VRF to be managed.
required: true
admin_state:
description:
- Administrative state of the VRF
- Administrative state of the VRF.
required: false
default: up
choices: ['up','down']
state:
description:
- Manages desired state of the resource
- Manages desired state of the resource.
required: false
default: present
choices: ['present','absent']

View file

@ -24,26 +24,28 @@ short_description: Manages interface specific VRF configuration
description:
- Manages interface specific VRF configuration
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- VRF needs to be added globally with M(nxos_vrf) before
adding a VRF to an interface
adding a VRF to an interface.
- Remove a VRF from an interface will still remove
all L3 attributes just as it does from CLI
all L3 attributes just as it does from CLI.
- VRF is not read from an interface until IP address is
configured on that interface
configured on that interface.
options:
vrf:
description:
- Name of VRF to be managed
- Name of VRF to be managed.
required: true
interface:
description:
- Full name of interface to be managed, i.e. Ethernet1/1
- Full name of interface to be managed, i.e. I(Ethernet1/1).
required: true
state:
description:
- Manages desired state of the resource
- Manages desired state of the resource.
required: false
default: present
choices: ['present','absent']

View file

@ -26,40 +26,42 @@ short_description: Manages VRRP configuration on NX-OS switches
description:
- Manages VRRP configuration on NX-OS switches
extends_documentation_fragment: nxos
author: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)
author:
- Jason Edelman (@jedelman8)
- Gabriele Gerbino (@GGabriele)
notes:
- VRRP feature needs to be enabled first on the system
- SVIs must exist before using this module
- Interface must be a L3 port before using this module
- state=absent removes the vrrp group if it exists on the device
- VRRP cannot be configured on loopback interfaces
- VRRP feature needs to be enabled first on the system.
- SVIs must exist before using this module.
- Interface must be a L3 port before using this module.
- C(state=absent) removes the vrrp group if it exists on the device.
- VRRP cannot be configured on loopback interfaces.
options:
group:
description:
- vrrp group number
- The VRRP group number.
required: true
interface:
description:
- Full name of interface that is being managed for vrrp
- Full name of interface that is being managed for VRRP.
required: true
priority:
description:
- vrrp priority
- VRRP priority.
required: false
default: null
vip:
description:
- hsrp virtual IP address
- HSRP virtual IP address.
required: false
default: null
authentication:
description:
- clear text authentication string
- Clear text authentication string.
required: false
default: null
state:
description:
- Specify desired state of the resource
- Specify desired state of the resource.
required: false
default: present
choices: ['present','absent']