From 505cded29b4f399a2dd9494409548a6fb7e4ccb8 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Fri, 20 Mar 2020 10:56:04 +0000 Subject: [PATCH] Support disabling Prometheus server This is useful to people who manage their Prometheus Server externally to Kolla Ansible, or want to use the exporters with another framework such as Monasca. Change-Id: Ie3f61e2e186c8e77e21a7b53d2bd7d2a27eee18e --- ansible/group_vars/all.yml | 1 + ansible/roles/prometheus/defaults/main.yml | 4 ++-- ansible/roles/prometheus/tasks/precheck.yml | 1 + etc/kolla/globals.yml | 1 + ...upport-disabling-prometheus-server-907be6846bc364df.yaml | 6 ++++++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/support-disabling-prometheus-server-907be6846bc364df.yaml 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.