diff --git a/defaults/main.yml b/defaults/main.yml index 4a80402..0500ca6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,6 +14,18 @@ geth_expo_cont_name: '{{ geth_expo_service_name }}-exporter' geth_expo_cont_addr: '0.0.0.0' geth_expo_cont_port: 9200 +# Consul config +geth_expo_consul_service_name: 'geth-exporter' +geth_expo_consul_scope: 'main' +geth_expo_consul_default_tags: + - 'geth' + - 'exporter' + - 'metrics' + - 'scope:{{ geth_expo_consul_scope }}' + - '{{ env }}.{{ stage }}' +geth_expo_consul_extra_tags: [] +geth_expo_consul_tags: '{{ geth_expo_consul_default_tags + geth_expo_consul_extra_tags }}' + # general container management compose_recreate: 'smart' compose_state: 'present' diff --git a/tasks/consul.yml b/tasks/consul.yml index 10efe00..748e78b 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -5,15 +5,15 @@ consul_config_name: '{{ geth_expo_cont_name }}' consul_services: # Prometheus config expects this service name - - name: 'geth-exporter' - id: '{{ geth_expo_cont_name }}' + - id: '{{ geth_expo_cont_name }}' + name: '{{ geth_expo_consul_service_name }}' + tags: '{{ geth_expo_consul_tags }}' port: '{{ geth_expo_cont_port }}' address: '{{ ansible_local.wireguard.vpn_ip }}' - tags: ['{{ geth_expo_cont_name }}', 'metrics', 'geth'] meta: container: '{{ geth_expo_source_cont_name | mandatory }}' checks: - id: '{{ geth_expo_cont_name }}-health' - name: 'geth-exporter healthcheck' - type: http + name: '{{ geth_expo_consul_service_name }} healthcheck' + type: 'http' http: 'http://localhost:{{ geth_expo_cont_port }}/health'