|
|
@ -90,13 +90,16 @@ commands:
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
from ansible.module_utils.nxos import load_config, run_commands
|
|
|
|
from ansible.module_utils.nxos import load_config, run_commands
|
|
|
|
from ansible.module_utils.nxos import nxos_argument_spec, check_args
|
|
|
|
from ansible.module_utils.nxos import nxos_argument_spec, check_args
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def map_obj_to_commands(want, have, module):
|
|
|
|
def map_obj_to_commands(want, have, module):
|
|
|
|
commands = list()
|
|
|
|
commands = list()
|
|
|
|
state = module.params['state']
|
|
|
|
state = module.params['state']
|
|
|
|
|
|
|
|
platform_regex = 'Nexus.*Switch'
|
|
|
|
|
|
|
|
|
|
|
|
if (state == 'absent' and (have.get('text') and have.get('text') != 'User Access Verification')):
|
|
|
|
if state == 'absent':
|
|
|
|
|
|
|
|
if (have.get('text') and not ((have.get('text') == 'User Access Verification') or re.match(platform_regex, have.get('text')))):
|
|
|
|
commands.append('no banner %s' % module.params['banner'])
|
|
|
|
commands.append('no banner %s' % module.params['banner'])
|
|
|
|
|
|
|
|
|
|
|
|
elif state == 'present' and want.get('text') != have.get('text'):
|
|
|
|
elif state == 'present' and want.get('text') != have.get('text'):
|
|
|
|