From f6878c69adce7b8cee83eeaf6e6b5555b53d8400 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 29 Dec 2023 09:29:29 -0500 Subject: [PATCH] Add enable_prometheus switch --- group_vars/default/base.yml | 4 +++- roles/pvc/defaults/main.yml | 2 +- roles/pvc/templates/pvc/pvc.conf.j2 | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/group_vars/default/base.yml b/group_vars/default/base.yml index 99f8785..3c4ffa8 100644 --- a/group_vars/default/base.yml +++ b/group_vars/default/base.yml @@ -28,7 +28,9 @@ debian_main_repository: http://ftp.debian.org/debian debian_security_repository: http://security.debian.org debian_pvc_repository: https://repo.parallelvirtualcluster.org/debian -# Enable Prometheus metric reporting from PVC nodes (installs prometheus-node-exporter) +# Enable Prometheus metric reporting from PVC nodes; installs prometheus-node-exporter and enables +# (unauthenticated) metrics endpoints within the PVC API. Set "no" to turn off Prometheus metric +# functionality. enable_prometheus_exporters: yes # Root user password diff --git a/roles/pvc/defaults/main.yml b/roles/pvc/defaults/main.yml index a740667..06a9244 100644 --- a/roles/pvc/defaults/main.yml +++ b/roles/pvc/defaults/main.yml @@ -21,7 +21,7 @@ pvc_fence_successful_action: migrate # What to do with VMs when a fence is su pvc_fence_failed_action: None # What to do with VMs when a fence is failed (migrate, None) - migrate is DANGEROUS without pvc_suicide_intervals set to < pvc_fence_intervals pvc_migrate_target_selector: mem # The selector to use for migrating VMs -# Enable Prometheus exporters +# Enable Prometheus exporters and corresponding API endpoints enable_prometheus_exporters: yes # Memory tuning diff --git a/roles/pvc/templates/pvc/pvc.conf.j2 b/roles/pvc/templates/pvc/pvc.conf.j2 index 141331b..8b3d190 100644 --- a/roles/pvc/templates/pvc/pvc.conf.j2 +++ b/roles/pvc/templates/pvc/pvc.conf.j2 @@ -15,6 +15,7 @@ subsystem: enable_storage: yes enable_worker: yes enable_api: yes + enable_prometheus: {{ 'yes' if enable_prometheus_exporters else 'no' }} cluster: name: {{ cluster_group }}