mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Fixes #27336 * Correct documentation errors
This commit is contained in:
parent
7292dd20ed
commit
f1cc5a928c
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,9 +208,10 @@ def main():
|
|||
if module.check_mode:
|
||||
module.exit_json(changed=True, commands=cmds)
|
||||
else:
|
||||
load_config(module, cmds)
|
||||
changed = True
|
||||
end_state = invoke('get_existing', module)
|
||||
if cmds:
|
||||
load_config(module, cmds)
|
||||
changed = True
|
||||
end_state = invoke('get_existing', module)
|
||||
|
||||
result['changed'] = changed
|
||||
if module._verbosity > 0:
|
||||
|
|
Loading…
Reference in a new issue