* Fixes #27336
* Correct documentation errors
(cherry picked from commit f1cc5a928c
)
This commit is contained in:
parent
4bf6b9aa27
commit
d9acf07150
1 changed files with 9 additions and 6 deletions
|
@ -35,7 +35,6 @@ author:
|
|||
- Gabriele Gerbino (@GGabriele)
|
||||
notes:
|
||||
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
|
||||
- This module is not idempotent when C(state=present).
|
||||
- C(state=absent) removes the whole profile.
|
||||
options:
|
||||
commands:
|
||||
|
@ -70,7 +69,7 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Create a maintenance-mode profile
|
||||
- nxos_gir_profile:
|
||||
- nxos_gir_profile_management:
|
||||
mode: maintenance
|
||||
commands:
|
||||
- router eigrp 11
|
||||
|
@ -79,7 +78,7 @@ EXAMPLES = '''
|
|||
username: "{{ un }}"
|
||||
password: "{{ pwd }}"
|
||||
# Remove the maintenance-mode profile
|
||||
- nxos_gir_profile:
|
||||
- nxos_gir_profile_management:
|
||||
mode: maintenance
|
||||
state: absent
|
||||
host: "{{ inventory_hostname }}"
|
||||
|
@ -146,6 +145,9 @@ def get_existing(module):
|
|||
|
||||
def state_present(module, existing, commands):
|
||||
cmds = list()
|
||||
if existing == commands:
|
||||
# Idempotent case
|
||||
return cmds
|
||||
cmds.extend(commands)
|
||||
if module.params['mode'] == 'maintenance':
|
||||
cmds.insert(0, 'configure maintenance profile maintenance-mode')
|
||||
|
@ -206,6 +208,7 @@ def main():
|
|||
if module.check_mode:
|
||||
module.exit_json(changed=True, commands=cmds)
|
||||
else:
|
||||
if cmds:
|
||||
load_config(module, cmds)
|
||||
changed = True
|
||||
end_state = invoke('get_existing', module)
|
||||
|
|
Loading…
Reference in a new issue