genvid.toolbox.ConsulService

class genvid.toolbox.ConsulService(**kwargs)

Bases: genvid.toolbox.service.ServiceTool

Base class for configuring the Consul service.

NAME = 'service-consul'
SERVICE_NAME = 'consul'
get_service_args(configdir, datadir, mode)

Return the base arguments depending on the Consul mode (dev or not).

get_recursors()
get_config(name, mode, datacenter, bind, wan, bootstrap, replace_dns, servers, ec2_tag, ec2_value, join_policy, node_id, **ignored)

Return the configuration as a dictionary acceptable as a JSON object.

The default configuration can be changed by overriding the result of this method.

Args:

name: The name of the node.

mode: The mode to run the service with (dev, server or client).

datacenter: The datacenter to associate with Consul.

bind: The advertised LAN IP address. Consul binds to “0.0.0.0” but
we need to advertise a single address.

wan: The advertised WAN IP address. Activates the WAN translation if present.

bootstrap: For server mode only: The number of bootstrap servers to
expect. Set to -1 to use the number of servers listed.
replace_dns: Run Consul on port 53 and add Consul to the list of
nameservers (Linux only for now).

servers: The list of servers to retry on bootup.

ec2_tag: ec2_tag and join_policy are mutually exclusive. ec2_tag is kept for backwards compatibility.
Tag on EC2 instance for servers. Must be an AWS instance.

ec2_value: Value on EC2 tag to check for servers. Must be an AWS instance.

join_policy: retry join policy to be used for retry_join consul configuration

node_id: The nodeid to be used. Elsewhere, a node id will be automatically generated.

class service.ConsulService

Implementation of genvid.toolbox.ConsulService