Class: Ansible::Ruby::Modules::Wait_for
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Wait_for
- 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
-
#active_connection_states ⇒ String?
The list of TCP connection states which are counted as active connections.
-
#connect_timeout ⇒ Integer?
Maximum number of seconds to wait for a connection to happen before closing and retrying.
-
#delay ⇒ Integer?
Number of seconds to wait before starting to poll.
-
#exclude_hosts ⇒ Array<String>, ...
List of hosts or IPs to ignore when looking for active TCP connections for C(drained) state.
-
#host ⇒ String?
A resolvable hostname or IP address to wait for.
-
#msg ⇒ String?
This overrides the normal error message from a failure to meet the required conditions.
-
#path ⇒ String?
Path to a file on the filesystem that must exist before continuing.
-
#port ⇒ Integer?
Port number to poll.
-
#search_regex ⇒ String?
Can be used to match a string in either a file or a socket connection.,Defaults to a multiline regex.
-
#sleep ⇒ Integer?
Number of seconds to sleep between checks, before 2.3 this was hardcoded to 1 second.
-
#state ⇒ :absent, ...
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.
-
#timeout ⇒ Integer?
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.
Methods inherited from Base
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_states ⇒ String?
Returns 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_timeout ⇒ Integer?
Returns 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 |
#delay ⇒ Integer?
Returns 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_hosts ⇒ Array<String>, ...
Returns 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 |
#host ⇒ String?
Returns 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 |
#msg ⇒ String?
Returns 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 |
#path ⇒ String?
Returns 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 |
#port ⇒ Integer?
Returns Port number to poll.
33 |
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 33 attribute :port |
#search_regex ⇒ String?
Returns 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 |
#sleep ⇒ Integer?
Returns 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.
41 |
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 41 attribute :state |
#timeout ⇒ Integer?
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.
21 |
# File 'lib/ansible/ruby/modules/generated/utilities/logic/wait_for.rb', line 21 attribute :timeout |