diff --git a/defaults/main.yml b/defaults/main.yml index 737bdc1..35f7b92 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,4 @@ consul_config_path: /etc/consul consul_service_tags: [] -consul_service_names: [] \ No newline at end of file +consul_service_names: [] +consul_service_meta: {} diff --git a/templates/service.json.j2 b/templates/service.json.j2 index cf5ea53..faaed15 100644 --- a/templates/service.json.j2 +++ b/templates/service.json.j2 @@ -15,6 +15,19 @@ {% if check.type == "http" -%} "name": "{{ check.id|default(consul_service_name) }} HTTP check", "http": {{ check.http | to_json }}, + "method": "{{ check.method|default("GET") }}", + {% if check.tls_server_name is defined -%} + "tls_server_name": "{{ check.tls_server_name|default("") }}", + {%- endif %} + {% if check.tls_skip_verify is defined -%} + "tls_skip_verify": {{ check.tls_skip_verify|default(False) | to_json }}, + {%- endif %} + {% if check.header is defined -%} + "header": {{ check.header | to_json }}, + {%- endif %} + {% if check.body is defined -%} + "body": {{ check.body | to_json }}, + {%- endif %} {% elif check.type == "tcp" -%} "name": "{{ check.id|default(consul_service_name) }} TCP check", {% if check.tcp is defined -%} @@ -44,6 +57,7 @@ {% endfor -%} ], {% endif -%} + "meta": {{ consul_service_meta|to_json }}, "tags": {{ consul_service_tags|to_json }} } }