Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated consul_snapshot.json.j2 to handle TLS correctly and fix line … #301

Merged
merged 2 commits into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ consul_tls_verify_incoming_https: false
consul_tls_verify_server_hostname: false
consul_tls_files_remote_src: false

consul_tls_min_version: "{{ lookup('env','CONSUL_TLS_MIN_VERSION') | default('tls12', true) }}"
consul_tls_cipher_suites: ""
consul_tls_prefer_server_cipher_suites: "{{ lookup('env','CONSUL_TLS_PREFER_SERVER_CIPHER_SUITES') | default('false', true) }}"

## DNS
consul_delegate_datacenter_dns: "{{ lookup('env','CONSUL_DELEGATE_DATACENTER_DNS') | default(false, true) }}"
consul_dnsmasq_enable: "{{ lookup('env','CONSUL_DNSMASQ_ENABLE') | default(false, true) }}"
Expand Down
5 changes: 5 additions & 0 deletions templates/config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"verify_outgoing": {{ consul_tls_verify_outgoing | bool | to_json }},
"verify_incoming_https": {{consul_tls_verify_incoming_https | bool| to_json }},
"verify_server_hostname": {{ consul_tls_verify_server_hostname | bool | to_json }},
"tls_min_version": "{{ consul_tls_min_version }}",
{% if consul_tls_cipher_suites is defined and consul_tls_cipher_suites %}
"tls_cipher_suites": "{{ vault_tls_cipher_suites}}",
{% endif %}
"tls_prefer_server_cipher_suites": {{ vault_tls_prefer_server_cipher_suites | bool | to_json }},
{% endif %}

{## LAN Join ##}
Expand Down
6 changes: 3 additions & 3 deletions templates/consul_snapshot.json.j2
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"snapshot_agent": {
"http_addr": "{{ consul_client_address }}:{% if consul_tls_enable | bool %}{{ consul_ports.https }}{% else %}{{ consul_ports.http }}{%endif%}",
{%- if consul_tls_enable | bool -%}
"http_addr": "{% if consul_tls_enable | bool %}https://{% endif %}{{ consul_client_address }}:{% if consul_tls_enable | bool %}{{ consul_ports.https }}{% else %}{{ consul_ports.http }}{% endif %}",
{% if consul_tls_enable | bool -%}
"ca_file": "{{ consul_tls_dir }}/{{ consul_tls_ca_crt }}",
"cert_file": "{{ consul_tls_dir }}/{{ consul_tls_server_crt }}",
"key_file": "{{ consul_tls_dir }}/{{ consul_server_key }}",
{%- endif -%}
{% endif %}
"log": {
"level": "INFO",
"enable_syslog": true,
Expand Down