aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2
blob: a9c1aff7b295a9dfd750da76f2cc3dfad0192d5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{% if nomad_use_consul | bool == True %}
consul {
    # Specifies the address to the local Consul agent, given in the format
    # host:port.
    address = "{{ nomad_consul_address }}"

    # Specifies if Nomad should advertise its services in Consul. The services
    # are named according to server_service_name and client_service_name. Nomad
    # servers and clients advertise their respective services, each tagged
    # appropriately with either http or rpc tag. Nomad servers also advertise a
    # serf tagged service.
    auto_advertise = true

    # Specifies if the Nomad clients should automatically discover servers in
    # the same region by searching for the Consul service name defined in the
    # server_service_name option. The search occurs if the client is not
    # registered with any servers or it is unable to heartbeat to the leader of
    # the region, in which case it may be partitioned and searches for other
    # servers.
    client_auto_join = true

    # Specifies the name of the service in Consul for the Nomad clients.
    client_service_name = "{{ nomad_consul_clients_service_name }}"

    # Specifies the name of the service in Consul for the Nomad servers.
    server_service_name = "{{ nomad_consul_servers_service_name }}"

    # Specifies if the Nomad servers should automatically discover and join
    # other Nomad servers by searching for the Consul service name defined in
    # the server_service_name option. This search only happens if the server
    # does not have a leader.
    server_auto_join = true

    # Specifies optional Consul tags to be registered with the Nomad server and
    # agent services.
    tags = {{ nomad_consul_tags | to_json }}

    # Specifies the token used to provide a per-request ACL token. This option
    # overrides the Consul Agent's default token. If the token is not set here
    # or on the Consul agent, it will default to Consul's anonymous policy,
    # which may or may not allow writes.
    token = "{{ nomad_consul_token }}"

    {% if nomad_consul_use_ssl | bool == True -%}
    # Specifies if the transport scheme should use HTTPS to communicate with the
    # Consul agent.
    ssl = true

    # Specifies an optional path to the CA certificate used for Consul
    # communication. This defaults to the system bundle if unspecified.
    ca_file = "{{ nomad_ca_file }}"

    # Specifies the path to the certificate used for Consul communication. If
    # this is set then you need to also set key_file.
    cert_file = "{{ nomad_cert_file }}"

    # Specifies the path to the private key used for Consul communication. If
    # this is set then you need to also set cert_file.
    key_file = "{{ nomad_key_file }}"
    {% endif %}

}
{% endif %}