genvid.toolbox.NomadService

class genvid.toolbox.NomadService(vault_policies_folder: str = '', vault_roles_folder: str = '', **kwargs)

Bases: genvid.toolbox.service.ServiceTool, genvid.toolbox.vault.VaultTool

Base Configuration of the nomad service.

NAME = 'service-nomad'
SERVICE_NAME = 'nomad'
get_config(name, mode, datacenter, region, bootstrap, bind, node_class, **ignored)

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

The default configuration could be change 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 this nomad instance.

region: The region to associate with this nomad instance.

bind: The service binding address (for client only).

bootstrap: For server mode only: the number of bootstrap servers to expect. Set to -1 to use the number of servers listed.

get_service_args(configdir, datadir, mode)

Return the based arguments depending on the service mode (dev or not).