|
|
|
@ -1,27 +1,12 @@
|
|
|
|
#!/usr/bin/python
|
|
|
|
#!/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/>.
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
|
|
|
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
'status': ['preview'],
|
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'network'}
|
|
|
|
'supported_by': 'network'}
|
|
|
|
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
DOCUMENTATION = r'''
|
|
|
|
---
|
|
|
|
---
|
|
|
|
module: nxos_hsrp
|
|
|
|
module: nxos_hsrp
|
|
|
|
extends_documentation_fragment: nxos
|
|
|
|
extends_documentation_fragment: nxos
|
|
|
|
@ -83,7 +68,7 @@ options:
|
|
|
|
default: 'present'
|
|
|
|
default: 'present'
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = r'''
|
|
|
|
- name: Ensure HSRP is configured with following params on a SVI
|
|
|
|
- name: Ensure HSRP is configured with following params on a SVI
|
|
|
|
nxos_hsrp:
|
|
|
|
nxos_hsrp:
|
|
|
|
group: 10
|
|
|
|
group: 10
|
|
|
|
@ -138,7 +123,7 @@ EXAMPLES = '''
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
RETURN = '''
|
|
|
|
RETURN = r'''
|
|
|
|
commands:
|
|
|
|
commands:
|
|
|
|
description: commands sent to the device
|
|
|
|
description: commands sent to the device
|
|
|
|
returned: always
|
|
|
|
returned: always
|
|
|
|
@ -408,9 +393,9 @@ def main():
|
|
|
|
elif len(kstr) == 1:
|
|
|
|
elif len(kstr) == 1:
|
|
|
|
auth_string = kstr[0]
|
|
|
|
auth_string = kstr[0]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
module.fail_json(msg='Inavlid auth_string')
|
|
|
|
module.fail_json(msg='Invalid auth_string')
|
|
|
|
if auth_enc != '0' and auth_enc != '7':
|
|
|
|
if auth_enc != '0' and auth_enc != '7':
|
|
|
|
module.fail_json(msg='Inavlid auth_string, only 0 or 7 allowed')
|
|
|
|
module.fail_json(msg='Invalid auth_string, only 0 or 7 allowed')
|
|
|
|
|
|
|
|
|
|
|
|
device_info = get_capabilities(module)
|
|
|
|
device_info = get_capabilities(module)
|
|
|
|
network_api = device_info.get('network_api', 'nxapi')
|
|
|
|
network_api = device_info.get('network_api', 'nxapi')
|
|
|
|
|