Class: Ansible::Ruby::Modules::Vyos_command

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb

Overview

The command module allows running one or more commands on remote devices running VyOS. This module can also be introspected to validate key parameters before returning successfully. If the conditional statements are not met in the wait period, the task fails. Certain C(show) commands in VyOS produce many lines of output and use a custom pager that can cause this module to hang. If the value of the environment variable C(ANSIBLE_VYOS_TERMINAL_LENGTH) is not set, the default number of 10000 is used.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#commandsArray<String>, String

Returns The ordered set of commands to execute on the remote device running VyOS. The output from the command execution is returned to the playbook. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied or the number of retries has been exceeded.

Returns:

  • (Array<String>, String)

    The ordered set of commands to execute on the remote device running VyOS. The output from the command execution is returned to the playbook. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied or the number of retries has been exceeded.



13
# File 'lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb', line 13

attribute :commands

#intervalInteger?

Returns Configures the interval in seconds to wait between I(retries) of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again.

Returns:

  • (Integer, nil)

    Configures the interval in seconds to wait between I(retries) of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again.



29
# File 'lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb', line 29

attribute :interval

#match:any, ...

Returns 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.

Returns:

  • (:any, :all, nil)

    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.



21
# File 'lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb', line 21

attribute :match

#retriesInteger?

Returns 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) conditionals.

Returns:

  • (Integer, nil)

    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) conditionals.



25
# File 'lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb', line 25

attribute :retries

#wait_forArray<String>, ...

Returns Specifies what to evaluate from the output of the command and what conditionals to apply. This argument will cause the task to wait for a particular conditional to be true before moving forward. If the conditional is not true by the configured I(retries), the task fails. See examples.

Returns:

  • (Array<String>, String, nil)

    Specifies what to evaluate from the output of the command and what conditionals to apply. This argument will cause the task to wait for a particular conditional to be true before moving forward. If the conditional is not true by the configured I(retries), the task fails. See examples.



17
# File 'lib/ansible/ruby/modules/generated/network/vyos/vyos_command.rb', line 17

attribute :wait_for