community.general/lib/ansible/modules/network/nxos/_nxos_mtu.py

125 lines
3.5 KiB
Python
Raw Normal View History

2016-09-15 12:10:08 +00:00
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
2017-08-16 03:16:38 +00:00
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'network'}
2016-12-06 10:35:05 +00:00
2016-09-15 12:10:08 +00:00
DOCUMENTATION = '''
---
module: nxos_mtu
extends_documentation_fragment: nxos
2016-09-15 12:10:08 +00:00
version_added: "2.2"
deprecated:
removed_in: "2.5"
why: Replaced with common C(*_system) network modules.
alternative: Use M(nxos_system)'s C(system_mtu) option. To specify an interfaces MTU use M(nxos_interface).
2016-09-15 12:10:08 +00:00
short_description: Manages MTU settings on Nexus switch.
description:
- Manages MTU settings on Nexus switch.
author:
- Jason Edelman (@jedelman8)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- Either C(sysmtu) param is required or (C(interface) AND C(mtu)) parameters are required.
2016-09-15 12:10:08 +00:00
- C(state=absent) unconfigures a given MTU if that value is currently present.
options:
interface:
description:
- Full name of interface, i.e. Ethernet1/1.
mtu:
description:
- MTU for a specific interface. Must be an even number between 576 and 9216.
2016-09-15 12:10:08 +00:00
sysmtu:
description:
- System jumbo MTU. Must be an even number between 576 and 9216.
2016-09-15 12:10:08 +00:00
state:
description:
- Specify desired state of the resource.
default: present
choices: ['present','absent']
'''
EXAMPLES = '''
# Ensure system mtu is 9126
- nxos_mtu:
sysmtu: 9216
host: "{{ inventory_hostname }}"
username: "{{ un }}"
password: "{{ pwd }}"
2016-09-15 12:10:08 +00:00
# Config mtu on Eth1/1 (routed interface)
- nxos_mtu:
interface: Ethernet1/1
mtu: 1600
host: "{{ inventory_hostname }}"
username: "{{ un }}"
password: "{{ pwd }}"
2016-09-15 12:10:08 +00:00
# Config mtu on Eth1/3 (switched interface)
- nxos_mtu:
interface: Ethernet1/3
mtu: 9216
host: "{{ inventory_hostname }}"
username: "{{ un }}"
password: "{{ pwd }}"
2016-09-15 12:10:08 +00:00
# Unconfigure mtu on a given interface
- nxos_mtu:
interface: Ethernet1/3
mtu: 9216
host: "{{ inventory_hostname }}"
username: "{{ un }}"
password: "{{ pwd }}"
state: absent
2016-09-15 12:10:08 +00:00
'''
RETURN = '''
proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"mtu": "1700"}
existing:
description:
- k/v pairs of existing mtu/sysmtu on the interface/system
returned: always
2016-09-15 12:10:08 +00:00
type: dict
sample: {"mtu": "1600", "sysmtu": "9216"}
end_state:
description: k/v pairs of mtu/sysmtu values after module execution
returned: always
type: dict
sample: {"mtu": "1700", sysmtu": "9216"}
2016-09-15 14:19:36 +00:00
updates:
2016-09-15 12:10:08 +00:00
description: command sent to the device
returned: always
type: list
sample: ["interface vlan10", "mtu 1700"]
changed:
description: check to see if a change was made on the device
returned: always
type: boolean
sample: true
'''
from ansible.module_utils.common.removed import removed_module
2016-09-15 12:10:08 +00:00
if __name__ == '__main__':
removed_module()