Class: Ansible::Ruby::Modules::Consul

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/extras/clustering/consul.rb

Overview

Registers services and checks for an agent with a consul cluster. A service is some process running on the agent node that should be advertised by consul’s discovery mechanism. It may optionally supply a check definition, a periodic service test to notify the consul cluster of service’s health. Checks may also be registered per node e.g. disk usage, or cpu usage and notify the health of the entire node to the cluster. Service level checks do not require a check name or id as these are derived by Consul from the Service name and id respectively by appending ‘service:’ Node level checks require a check_name and optionally a check_id. Currently, there is no complete way to retrieve the script, interval or ttl metadata for a registered check. Without this metadata it is not possible to tell if the data supplied with ansible represents a change to a check. As a result this does not attempt to determine changes and will always report a changed occurred. An api method is planned to supply this metadata so at that stage change management will be added. See consul.io for more details.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

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

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

Constructor Details

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

Instance Method Details

#check_idString?

Returns an ID for the service check, defaults to the check name, ignored if part of a service definition.

Returns:

  • (String, nil)

    an ID for the service check, defaults to the check name, ignored if part of a service definition.



65
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 65

attribute :check_id

#check_nameString?

Returns a name for the service check, defaults to the check id. required if standalone, ignored if part of service definition.

Returns:

  • (String, nil)

    a name for the service check, defaults to the check id. required if standalone, ignored if part of service definition.



69
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 69

attribute :check_name

#hostString?

Returns host of the consul agent defaults to localhost.

Returns:

  • (String, nil)

    host of the consul agent defaults to localhost



26
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 26

attribute :host

#httpString?

Returns checks can be registered with an http endpoint. This means that consul will check that the http endpoint returns a successful http status. Interval must also be provided with this option.

Returns:

  • (String, nil)

    checks can be registered with an http endpoint. This means that consul will check that the http endpoint returns a successful http status. Interval must also be provided with this option.



76
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 76

attribute :http

#intervalString?

Returns the interval at which the service check will be run. This is a number with a s or m suffix to signify the units of seconds or minutes e.g 15s or 1m. If no suffix is supplied, m will be used by default e.g. 1 will be 1m. Required if the script param is specified.

Returns:

  • (String, nil)

    the interval at which the service check will be run. This is a number with a s or m suffix to signify the units of seconds or minutes e.g 15s or 1m. If no suffix is supplied, m will be used by default e.g. 1 will be 1m. Required if the script param is specified.



61
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 61

attribute :interval

#notesObject?

Returns Notes to attach to check when registering it.

Returns:

  • (Object, nil)

    Notes to attach to check when registering it.



42
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 42

attribute :notes

#portInteger?

Returns the port on which the consul agent is running.

Returns:

  • (Integer, nil)

    the port on which the consul agent is running



30
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 30

attribute :port

#schemeString?

Returns the protocol scheme on which the consul agent is running.

Returns:

  • (String, nil)

    the protocol scheme on which the consul agent is running



34
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 34

attribute :scheme

#scriptString?

Returns the script/command that will be run periodically to check the health of the service. Scripts require an interval and vise versa.

Returns:

  • (String, nil)

    the script/command that will be run periodically to check the health of the service. Scripts require an interval and vise versa



57
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 57

attribute :script

#service_addressString?

Returns the address to advertise that the service will be listening on. This value will be passed as the I(Address) parameter to Consul’s U(/v1/agent/service/register) API method, so refer to the Consul API documentation for further details.

Returns:

  • (String, nil)

    the address to advertise that the service will be listening on. This value will be passed as the I(Address) parameter to Consul’s U(/v1/agent/service/register) API method, so refer to the Consul API documentation for further details.



49
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 49

attribute :service_address

#service_idString?

Returns the ID for the service, must be unique per node, defaults to the service name if the service name is supplied.

Returns:

  • (String, nil)

    the ID for the service, must be unique per node, defaults to the service name if the service name is supplied



22
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 22

attribute :service_id

#service_nameString?

Returns Unique name for the service on a node, must be unique per node, required if registering a service. May be ommitted if registering a node level check.

Returns:

  • (String, nil)

    Unique name for the service on a node, must be unique per node, required if registering a service. May be ommitted if registering a node level check



18
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 18

attribute :service_name

#service_portInteger?

Returns the port on which the service is listening required for registration of a service, i.e. if service_name or service_id is set.

Returns:

  • (Integer, nil)

    the port on which the service is listening required for registration of a service, i.e. if service_name or service_id is set



45
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 45

attribute :service_port

#state:present, :absent

Returns register or deregister the consul service, defaults to present.

Returns:

  • (:present, :absent)

    register or deregister the consul service, defaults to present



14
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 14

attribute :state

#tagsArray<String>, ...

Returns a list of tags that will be attached to the service registration.

Returns:

  • (Array<String>, String, nil)

    a list of tags that will be attached to the service registration.



53
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 53

attribute :tags

#timeoutObject?

Returns A custom HTTP check timeout. The consul default is 10 seconds. Similar to the interval this is a number with a s or m suffix to signify the units of seconds or minutes, e.g. 15s or 1m.

Returns:

  • (Object, nil)

    A custom HTTP check timeout. The consul default is 10 seconds. Similar to the interval this is a number with a s or m suffix to signify the units of seconds or minutes, e.g. 15s or 1m.



80
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 80

attribute :timeout

#tokenObject?

Returns the token key indentifying an ACL rule set. May be required to register services.

Returns:

  • (Object, nil)

    the token key indentifying an ACL rule set. May be required to register services.



83
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 83

attribute :token

#ttlObject?

Returns checks can be registered with a ttl instead of a script and interval this means that the service will check in with the agent before the ttl expires. If it doesn’t the check will be considered failed. Required if registering a check and the script an interval are missing Similar to the interval this is a number with a s or m suffix to signify the units of seconds or minutes e.g 15s or 1m. If no suffix is supplied, m will be used by default e.g. 1 will be 1m.

Returns:

  • (Object, nil)

    checks can be registered with a ttl instead of a script and interval this means that the service will check in with the agent before the ttl expires. If it doesn’t the check will be considered failed. Required if registering a check and the script an interval are missing Similar to the interval this is a number with a s or m suffix to signify the units of seconds or minutes e.g 15s or 1m. If no suffix is supplied, m will be used by default e.g. 1 will be 1m



73
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 73

attribute :ttl

#validate_certsBoolean?

Returns whether to verify the tls certificate of the consul agent.

Returns:

  • (Boolean, nil)

    whether to verify the tls certificate of the consul agent



38
# File 'lib/ansible/ruby/modules/generated/extras/clustering/consul.rb', line 38

attribute :validate_certs