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, 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: 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.
node_id: The nodeid to be used. Elsewhere, a node id will be automatically generated.
-
-
class
service.
ConsulService
¶ Implementation of
genvid.toolbox.ConsulService