diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 8409d254ce..702ac7fa60 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1118,6 +1118,7 @@ prometheus_elasticsearch_exporter_interval: "{{ prometheus_scrape_interval }}" prometheus_cmdline_extras: prometheus_ceph_mgr_exporter_endpoints: [] prometheus_openstack_exporter_endpoint_type: "internal" +prometheus_openstack_exporter_compute_api_version: "latest" prometheus_libvirt_exporter_interval: "60s" ############ diff --git a/ansible/roles/prometheus/defaults/main.yml b/ansible/roles/prometheus/defaults/main.yml index d4bc516e40..4c8e9b9b05 100644 --- a/ansible/roles/prometheus/defaults/main.yml +++ b/ansible/roles/prometheus/defaults/main.yml @@ -76,6 +76,8 @@ prometheus_services: container_name: "prometheus_openstack_exporter" group: "prometheus-openstack-exporter" enabled: "{{ enable_prometheus_openstack_exporter | bool }}" + environment: + OS_COMPUTE_API_VERSION: "{{ prometheus_openstack_exporter_compute_api_version }}" image: "{{ prometheus_openstack_exporter_image_full }}" volumes: "{{ prometheus_openstack_exporter_default_volumes + prometheus_openstack_exporter_extra_volumes }}" dimensions: "{{ prometheus_openstack_exporter_dimensions }}" diff --git a/ansible/roles/prometheus/handlers/main.yml b/ansible/roles/prometheus/handlers/main.yml index d155cf825c..e8868b9c80 100644 --- a/ansible/roles/prometheus/handlers/main.yml +++ b/ansible/roles/prometheus/handlers/main.yml @@ -117,6 +117,7 @@ image: "{{ service.image }}" volumes: "{{ service.volumes }}" dimensions: "{{ service.dimensions }}" + environment: "{{ service.environment|default(omit) }}" when: - kolla_action != "config" diff --git a/ansible/roles/prometheus/tasks/check-containers.yml b/ansible/roles/prometheus/tasks/check-containers.yml index 7aa6ae378e..0f74139b95 100644 --- a/ansible/roles/prometheus/tasks/check-containers.yml +++ b/ansible/roles/prometheus/tasks/check-containers.yml @@ -9,6 +9,7 @@ pid_mode: "{{ item.value.pid_mode|default('') }}" volumes: "{{ item.value.volumes }}" dimensions: "{{ item.value.dimensions }}" + environment: "{{ item.value.environment|default(omit) }}" when: - inventory_hostname in groups[item.value.group] - item.value.enabled | bool diff --git a/releasenotes/notes/openstack-exporter-nova-version-9e75cb7ec04658f2.yaml b/releasenotes/notes/openstack-exporter-nova-version-9e75cb7ec04658f2.yaml new file mode 100644 index 0000000000..5eaa169a5c --- /dev/null +++ b/releasenotes/notes/openstack-exporter-nova-version-9e75cb7ec04658f2.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Adds support for configuring the Openstack Compute API microversion used by + the OpenStack exporter for Prometheus using the + ``prometheus_openstack_exporter_compute_api_version`` variable. The default + value is ``latest``, matching the default behaviour of the exporter.