mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Ansible 2.5 feature support for dellos9 (#34880)
* Add ansible-2.5 support for dellos9 * Fix ansible-test issues and update copyright * fix ansible-test errors in dellos9_config * fix izip attribute error in python3 * fix python3 dict.keys() issue * Remove waitfor aliases in dellos9_command
This commit is contained in:
parent
9f84a12adf
commit
19ff2f4e8c
23 changed files with 2356 additions and 155 deletions
|
@ -20,7 +20,7 @@ author: "Dhivya P (@dhivyap)"
|
|||
short_description: Run commands on remote devices running Dell OS9
|
||||
description:
|
||||
- Sends arbitrary commands to a Dell OS9 node and returns the results
|
||||
read from the device. This module includes an
|
||||
read from the device. This module includes an
|
||||
argument that will cause the module to wait for a specific condition
|
||||
before returning or timing out if the condition is not met.
|
||||
- This module does not support running commands in configuration mode.
|
||||
|
@ -44,6 +44,19 @@ 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 be tried
|
||||
|
@ -72,33 +85,21 @@ notes:
|
|||
"""
|
||||
|
||||
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
|
||||
dellos9_command:
|
||||
commands: show version
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: run show version and check to see if output contains OS9
|
||||
dellos9_command:
|
||||
commands: show version
|
||||
wait_for: result[0] contains OS9
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: run multiple commands on remote nodes
|
||||
dellos9_command:
|
||||
commands:
|
||||
- show version
|
||||
- show interfaces
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: run multiple commands and evaluate the output
|
||||
dellos9_command:
|
||||
|
@ -108,7 +109,6 @@ tasks:
|
|||
wait_for:
|
||||
- result[0] contains OS9
|
||||
- result[1] contains Loopback
|
||||
provider: "{{ cli }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
@ -225,11 +225,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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue