feat(ansible): Nomad update
[csit.git] / fdio.infra.ansible / roles / nomad / templates / consul.hcl.j2
index 6d30676..a9c1aff 100644 (file)
@@ -1,18 +1,63 @@
 {% if nomad_use_consul | bool == True %}
 consul {
-    # The address to the Consul agent.
+    # Specifies the address to the local Consul agent, given in the format
+    # host:port.
     address = "{{ nomad_consul_address }}"
-    token = "{{ nomad_consul_token }}"
-    # The service name to register the server and client with Consul.
-    server_service_name = "{{ nomad_consul_servers_service_name }}"
-    client_service_name = "{{ nomad_consul_clients_service_name }}"
-    tags = {{ nomad_consul_tags | to_json }}
 
-    # Enables automatically registering the services.
+    # 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
 
-    # Enabling the server and client to bootstrap using Consul.
-    server_auto_join = 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 %}
\ No newline at end of file