Skip to content

Commit

Permalink
consul config - add grpc_tls option (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
garry-t authored Nov 14, 2024
1 parent aa9093d commit cacfacd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions automation/roles/consul/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ consul_addresses:
https: "{{ consul_addresses_https | default(consul_client_address, true) }}"
rpc: "{{ consul_addresses_rpc | default(consul_client_address, true) }}"
grpc: "{{ consul_addresses_grpc | default(consul_client_address, true) }}"
grpc_tls: "{{ consul_addresses_grpc_tls | default(consul_client_address, true) }}"

### Ports
consul_ports:
Expand All @@ -155,6 +156,7 @@ consul_ports:
serf_wan: "{{ consul_ports_serf_wan | default('8302', true) }}"
server: "{{ consul_ports_server | default('8300', true) }}"
grpc: "{{ consul_ports_grpc | default('-1', true) }}"
grpc_tls: "{{ consul_ports_grpc_tls | default('-1', true) }}"

### Servers
consul_group_name: "{{ lookup('env', 'CONSUL_GROUP_NAME') | default('consul_instances', true) }}"
Expand Down
10 changes: 8 additions & 2 deletions automation/roles/consul/templates/config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"http": "{{ consul_addresses.http }}",
"https": "{{ consul_addresses.https }}",
{% if consul_version is version_compare('1.3.0', '>=') %}
"grpc": "{{ consul_addresses.grpc }}"
"grpc": "{{ consul_addresses.grpc }}",
{% endif %}
{% if consul_version is version_compare('1.14.0', '>=') and consul_tls_enable %}
"grpc_tls": "{{ consul_addresses.grpc_tls }}",
{% endif %}
},
{## Ports Used ##}
Expand All @@ -47,7 +50,10 @@
"serf_wan": {{ consul_ports.serf_wan }},
"server": {{ consul_ports.server }},
{% if consul_version is version_compare('1.3.0', '>=') %}
"grpc": {{ consul_ports.grpc }}
"grpc": {{ consul_ports.grpc }},
{% endif %}
{% if consul_version is version_compare('1.14.0', '>=') and consul_tls_enable %}
"grpc_tls": {{ consul_ports.grpc_tls }},
{% endif %}
},

Expand Down

0 comments on commit cacfacd

Please sign in to comment.