mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
adds new module net_command for network devices (#19468)
* new module net_command for sending a command to a network device * adds unit test cases for module * only works with connection=network_cli
This commit is contained in:
parent
b77ab1a6c9
commit
2a5a2773c8
6 changed files with 244 additions and 4 deletions
|
@ -31,6 +31,7 @@ from ansible.template import Templar
|
|||
RAW_PARAM_MODULES = ([
|
||||
'command',
|
||||
'win_command',
|
||||
'net_command',
|
||||
'shell',
|
||||
'win_shell',
|
||||
'script',
|
||||
|
@ -164,7 +165,7 @@ class ModuleArgsParser:
|
|||
|
||||
# only internal variables can start with an underscore, so
|
||||
# we don't allow users to set them directy in arguments
|
||||
if args and action not in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw'):
|
||||
if args and action not in ('command', 'net_command', 'win_command', 'shell', 'win_shell', 'script', 'raw'):
|
||||
for arg in args:
|
||||
arg = to_text(arg)
|
||||
if arg.startswith('_ansible_'):
|
||||
|
@ -195,7 +196,7 @@ class ModuleArgsParser:
|
|||
args = thing
|
||||
elif isinstance(thing, string_types):
|
||||
# form is like: local_action: copy src=a dest=b ... pretty common
|
||||
check_raw = action in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw')
|
||||
check_raw = action in ('command', 'net_command', 'win_command', 'shell', 'win_shell', 'script', 'raw')
|
||||
args = parse_kv(thing, check_raw=check_raw)
|
||||
elif thing is None:
|
||||
# this can happen with modules which take no params, like ping:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue