diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index d065f3bee8..ffefbf87aa 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1013,6 +1013,7 @@ use_common_mariadb_user: "no" ############ # Prometheus ############ +enable_prometheus_server: "{{ enable_prometheus | bool }}" enable_prometheus_haproxy_exporter: "{{ enable_haproxy | bool }}" enable_prometheus_mysqld_exporter: "{{ enable_mariadb | bool }}" enable_prometheus_node_exporter: "{{ enable_prometheus | bool }}" diff --git a/ansible/roles/prometheus/defaults/main.yml b/ansible/roles/prometheus/defaults/main.yml index ae6f29275a..5d462cced0 100644 --- a/ansible/roles/prometheus/defaults/main.yml +++ b/ansible/roles/prometheus/defaults/main.yml @@ -5,13 +5,13 @@ prometheus_services: prometheus-server: container_name: prometheus_server group: prometheus - enabled: true + enabled: "{{ enable_prometheus_server }}" image: "{{ prometheus_server_image_full }}" volumes: "{{ prometheus_server_default_volumes + prometheus_server_extra_volumes }}" dimensions: "{{ prometheus_server_dimensions }}" haproxy: prometheus_server: - enabled: "{{ enable_prometheus }}" + enabled: "{{ enable_prometheus_server }}" mode: "http" external: false port: "{{ prometheus_port }}" diff --git a/ansible/roles/prometheus/tasks/precheck.yml b/ansible/roles/prometheus/tasks/precheck.yml index 2b6c6c2d77..f214a537df 100644 --- a/ansible/roles/prometheus/tasks/precheck.yml +++ b/ansible/roles/prometheus/tasks/precheck.yml @@ -25,6 +25,7 @@ when: - container_facts['prometheus_server'] is not defined - inventory_hostname in groups['prometheus'] + - enable_prometheus_server | bool - name: Checking free port for Prometheus node_exporter wait_for: diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 524edaa244..c31b9f39df 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -632,6 +632,7 @@ ############ # Prometheus ############ +#enable_prometheus_server: "{{ enable_prometheus | bool }}" #enable_prometheus_haproxy_exporter: "{{ enable_haproxy | bool }}" #enable_prometheus_mysqld_exporter: "{{ enable_mariadb | bool }}" #enable_prometheus_node_exporter: "{{ enable_prometheus | bool }}" diff --git a/releasenotes/notes/support-disabling-prometheus-server-907be6846bc364df.yaml b/releasenotes/notes/support-disabling-prometheus-server-907be6846bc364df.yaml new file mode 100644 index 0000000000..00bb4d163f --- /dev/null +++ b/releasenotes/notes/support-disabling-prometheus-server-907be6846bc364df.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Prometheus server can now be disabled, allowing the exporters to be + deployed without it. The default behaviour of deploying Prometheus + server when Prometheus is enabled remains.