Class: Ansible::Ruby::Modules::Wait_for

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb,
lib/ansible/ruby/modules/custom/utilities/logic/wait_for.rb

Overview

You can wait for a set amount of time C(timeout), this is the default if nothing is specified or just C(timeout) is specified. This does not produce an error. Waiting for a port to become available is useful for when services are not immediately available after their init scripts return which is true of certain Java application servers. It is also useful when starting guests with the M(virt) module and needing to pause until they are ready. This module can also be used to wait for a regex match a string to be present in a file. In 1.6 and later, this module can also be used to wait for a file to be available or absent on the filesystem. In 1.8 and later, this module can also be used to wait for active connections to be closed before continuing, useful if a node is being rotated out of a load balancer pool. For Windows targets, use the M(win_wait_for) module instead.

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

#active_connection_statesString?

Returns The list of TCP connection states which are counted as active connections.

Returns:

  • (String, nil)

    The list of TCP connection states which are counted as active connections.



37
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 37

attribute :active_connection_states

#connect_timeoutInteger?

Returns Maximum number of seconds to wait for a connection to happen before closing and retrying.

Returns:

  • (Integer, nil)

    Maximum number of seconds to wait for a connection to happen before closing and retrying.



25
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 25

attribute :connect_timeout

#delayInteger?

Returns Number of seconds to wait before starting to poll.

Returns:

  • (Integer, nil)

    Number of seconds to wait before starting to poll.



29
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 29

attribute :delay

#exclude_hostsArray<String>, ...

Returns List of hosts or IPs to ignore when looking for active TCP connections for C(drained) state.

Returns:

  • (Array<String>, String, nil)

    List of hosts or IPs to ignore when looking for active TCP connections for C(drained) state.



53
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 53

attribute :exclude_hosts

#hostString?

Returns A resolvable hostname or IP address to wait for.

Returns:

  • (String, nil)

    A resolvable hostname or IP address to wait for.



17
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 17

attribute :host

#msgString?

Returns This overrides the normal error message from a failure to meet the required conditions.

Returns:

  • (String, nil)

    This overrides the normal error message from a failure to meet the required conditions.



61
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 61

attribute :msg

#pathString?

Returns Path to a file on the filesystem that must exist before continuing.

Returns:

  • (String, nil)

    Path to a file on the filesystem that must exist before continuing.



45
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 45

attribute :path

#portInteger?

Returns Port number to poll.

Returns:

  • (Integer, nil)

    Port number to poll.



33
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 33

attribute :port

#search_regexString?

Returns Can be used to match a string in either a file or a socket connection.,Defaults to a multiline regex.

Returns:

  • (String, nil)

    Can be used to match a string in either a file or a socket connection.,Defaults to a multiline regex.



49
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 49

attribute :search_regex

#sleepInteger?

Returns Number of seconds to sleep between checks, before 2.3 this was hardcoded to 1 second.

Returns:

  • (Integer, nil)

    Number of seconds to sleep between checks, before 2.3 this was hardcoded to 1 second.



57
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 57

attribute :sleep

#state:absent, ...

Returns Either C(present), C(started), or C(stopped), C(absent), or C(drained).,When checking a port C(started) will ensure the port is open, C(stopped) will check that it is closed, C(drained) will check for active connections.,When checking for a file or a search string C(present) or C(started) will ensure that the file or string is present before continuing, C(absent) will check that file is absent or removed.

Returns:

  • (:absent, :drained, :present, :started, :stopped, nil)

    Either C(present), C(started), or C(stopped), C(absent), or C(drained).,When checking a port C(started) will ensure the port is open, C(stopped) will check that it is closed, C(drained) will check for active connections.,When checking for a file or a search string C(present) or C(started) will ensure that the file or string is present before continuing, C(absent) will check that file is absent or removed.



41
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 41

attribute :state

#timeoutInteger?

Returns Maximum number of seconds to wait for, when used with another condition it will force an error.,When used without other conditions it is equivalent of just sleeping.

Returns:

  • (Integer, nil)

    Maximum number of seconds to wait for, when used with another condition it will force an error.,When used without other conditions it is equivalent of just sleeping.



21
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 21

attribute :timeout