aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2')
-rw-r--r--fdio.infra.ansible/roles/nomad/templates/consul.hcl.j263
1 files changed, 63 insertions, 0 deletions
diff --git a/fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2 b/fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2
new file mode 100644
index 0000000000..a9c1aff7b2
--- /dev/null
+++ b/fdio.infra.ansible/roles/nomad/templates/consul.hcl.j2
@@ -0,0 +1,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 %} \ No newline at end of file