diff --git a/docs/services/prometheus-ssh-exporter.md b/docs/services/prometheus-ssh-exporter.md index 56ec936..0de1ea6 100644 --- a/docs/services/prometheus-ssh-exporter.md +++ b/docs/services/prometheus-ssh-exporter.md @@ -15,12 +15,14 @@ To enable this service, add the following configuration to your `vars.yml` file prometheus_ssh_exporter_enabled: true -# if you want to export ssh's probe endpoint, uncomment and adjust the following vars - +# To expose the metrics publicly, enable and configure the lines below: # prometheus_ssh_exporter_hostname: mash.example.com -# prometheus_ssh_exporter_path_prefix: /metrics/ssh-exporter -# prometheus_ssh_exporter_basicauth_user: your_username -# prometheus_ssh_exporter_basicauth_password: your password +# prometheus_ssh_exporter_path_prefix: /metrics/mash-prometheus-ssh-exporter + +# To protect the metrics with HTTP Basic Auth, enable and configure the lines below. +# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users +# prometheus_ssh_exporter_container_labels_metrics_middleware_basic_auth_enabled: true +# prometheus_ssh_exporter_container_labels_metrics_middleware_basic_auth_users: '' ######################################################################## # # @@ -31,4 +33,4 @@ prometheus_ssh_exporter_enabled: true ## Usage -After you've installed the ssh exporter, your ssh prober will be available on `mash.example.com/metrics/ssh-exporter` with the basic auth credentials you've configured if hostname and path prefix where provided +After you've installed the ssh exporter, your ssh prober will be available on `mash.example.com/metrics/mash-prometheus-ssh-exporter` with the basic auth credentials you've configured if hostname and path prefix were provided. diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index e2555f0..27aff9a 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -3866,15 +3866,13 @@ prometheus_ssh_exporter_enabled: false prometheus_ssh_exporter_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-ssh-exporter" +prometheus_ssh_exporter_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ prometheus_ssh_exporter_identifier }}" + prometheus_ssh_exporter_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}prometheus-ssh-exporter" prometheus_ssh_exporter_uid: "{{ mash_playbook_uid }}" prometheus_ssh_exporter_gid: "{{ mash_playbook_gid }}" -prometheus_ssh_exporter_basicauth_enabled: "{{ prometheus_ssh_exporter_container_labels_traefik_enabled }}" -prometheus_ssh_exporter_basicauth_user: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'ssh.user', rounds=655555) | to_uuid }}" -prometheus_ssh_exporter_basicauth_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'ssh.password', rounds=655555) | to_uuid }}" - prometheus_ssh_exporter_container_additional_networks: | {{ ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) @@ -3886,6 +3884,9 @@ prometheus_ssh_exporter_container_labels_traefik_docker_network: "{{ mash_playbo prometheus_ssh_exporter_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" prometheus_ssh_exporter_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" +prometheus_ssh_exporter_container_labels_metrics_middleware_basic_auth_enabled: "{{ mash_playbook_metrics_exposure_http_basic_auth_enabled }}" +prometheus_ssh_exporter_container_labels_metrics_middleware_basic_auth_users: "{{ mash_playbook_metrics_exposure_http_basic_auth_users }}" + ######################################################################## # # # /prometheus_ssh_exporter # diff --git a/templates/requirements.yml b/templates/requirements.yml index 833c9b9..840d0b8 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -253,7 +253,7 @@ name: prometheus_postgres_exporter activation_prefix: prometheus_postgres_exporter_ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-ssh-exporter.git - version: v1.5.0-1 + version: v1.5.0-2 name: prometheus_ssh_exporter activation_prefix: prometheus_ssh_exporter_ - src: git+https://gitlab.com/etke.cc/roles/radicale.git