Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915)

* Support for network_cli plugin and tests

* Fixed ansible-test * issues

* Fixed Pylint warning

* Fixed the sanity test errors

* Fix YAMLlinter issue - removed blank spaces

* Fixed Python 3 failures

* Fixed the PEP8 issue

* Fix sanity --test validate-modules

* Reverted the changes to the doc fragments
This commit is contained in:
Senthil Kumar Ganesan 2018-01-25 04:37:27 -08:00 committed by John R Barker
commit 2f46f8f944
51 changed files with 22371 additions and 160 deletions

View file

@ -45,9 +45,22 @@ options:
See examples.
required: false
default: null
version_added: "2.2"
match:
description:
- The I(match) argument is used in conjunction with the
I(wait_for) argument to specify the match policy. Valid
values are C(all) or C(any). If the value is set to C(all)
then all conditionals in the wait_for must be satisfied. If
the value is set to C(any) then only one of the values must be
satisfied.
required: false
default: all
choices: ['any', 'all']
version_added: "2.5"
retries:
description:
- Specifies the number of retries a command should by tried
- Specifies the number of retries a command should be tried
before it is considered failed. The command is run on the
target device every retry and evaluated against the
I(wait_for) conditions.
@ -64,33 +77,21 @@ options:
"""
EXAMPLES = """
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
vars:
cli:
host: "{{ inventory_hostname }}"
username: admin
password: admin
transport: cli
tasks:
- name: run show version on remote devices
dellos10_command:
commands: show version
provider: "{{ cli }}"
- name: run show version and check to see if output contains OS10
dellos10_command:
commands: show version
wait_for: result[0] contains OS10
provider: "{{ cli }}"
- name: run multiple commands on remote nodes
dellos10_command:
commands:
- show version
- show interface
provider: "{{ cli }}"
- name: run multiple commands and evaluate the output
dellos10_command:
@ -100,7 +101,6 @@ tasks:
wait_for:
- result[0] contains OS10
- result[1] contains Ethernet
provider: "{{ cli }}"
"""
RETURN = """
@ -109,19 +109,16 @@ stdout:
returned: always apart from low level errors (such as action plugin)
type: list
sample: ['...', '...']
stdout_lines:
description: The value of stdout split into a list
returned: always apart from low level errors (such as action plugin)
type: list
sample: [['...', '...'], ['...'], ['...']]
failed_conditions:
description: The list of conditionals that have failed
returned: failed
type: list
sample: ['...', '...']
warnings:
description: The list of warnings (if any) generated by module based on arguments
returned: always
@ -220,11 +217,11 @@ def main():
msg = 'One or more conditional statements have not be satisfied'
module.fail_json(msg=msg, failed_conditions=failed_conditions)
result = {
result.update({
'changed': False,
'stdout': responses,
'stdout_lines': list(to_lines(responses))
}
})
module.exit_json(**result)