add common arguments to eos_banner (#22024)

fixes #22015
This commit is contained in:
Peter Sprygada 2017-02-27 20:22:42 -05:00 committed by GitHub
parent fcac261eef
commit 3c401f9ba2

View file

@ -94,6 +94,7 @@ session_name:
""" """
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.eos import load_config, run_commands from ansible.module_utils.eos import load_config, run_commands
from ansible.module_utils.eos import eos_argument_spec, check_args
def map_obj_to_commands(updates, module): def map_obj_to_commands(updates, module):
commands = list() commands = list()
@ -139,13 +140,20 @@ def main():
state=dict(default='present', choices=['present', 'absent']) state=dict(default='present', choices=['present', 'absent'])
) )
argument_spec.update(eos_argument_spec)
required_if = [('state', 'present', ('text',))] required_if = [('state', 'present', ('text',))]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
required_if=required_if, required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
warnings = list()
check_args(module, warnings)
result = {'changed': False} result = {'changed': False}
if warnings:
result['warnings'] = warnings
want = map_params_to_obj(module) want = map_params_to_obj(module)
have = map_config_to_obj(module) have = map_config_to_obj(module)