Skip to content
Snippets Groups Projects
Commit 99e203e2 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "CI: validate prometheus configs"

parents 22af53bf e38ca5c7
No related branches found
No related tags found
No related merge requests found
---
- name: Validating prometheus config files
vars:
service: "{{ prometheus_services['prometheus-server'] }}"
shell: >-
{{ kolla_container_engine }} exec -i {{ service.container_name }} bash -c
"/opt/prometheus/promtool check config /etc/prometheus/prometheus.yml;
/opt/prometheus/promtool check web-config /etc/prometheus/web.yml"
register: "prometheus_config_validation_results"
check_mode: false
become: true
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Assert prometheus config files are valid
vars:
service: "{{ prometheus_services['prometheus-server'] }}"
assert:
that: "prometheus_config_validation_results.rc == 0"
fail_msg: >-
"{{ service.container_name }} config files are invalid, the output was:
{{ prometheus_config_validation_results.stdout }}"
success_msg: >-
"{{ service.container_name }} config files are valid"
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
......@@ -177,3 +177,19 @@ Run the deployment:
kolla-ansible deploy -i <path/to/multinode/inventory/file>
Validate generated configuration files of enabled services:
.. code-block:: console
kolla-ansible validate-config -i <path/to/multinode/inventory/file>
.. note::
Due to the nature of the configuration generation the validation can
currently only be done after the first deployment. For some validations
it is necessary to access the running containers.
The validation tasks can be found - and altered - in each ansible role under
``kolla-ansible/ansible/roles/$role/tasks/config_validate.yml``.
The validation for most openstack services is done by the special role:
``service-config-validate``.
---
features:
- |
kolla-ansible now validates the Prometheus configuration files when
called via ``kolla-ansible -i $inventory validate-config``. This
validation is done by running the ``promtool check config`` command.
See the `documentation <https://docs.openstack.org/kolla-ansible/latest/user/multinode.html>`__
for the ``kolla-ansible validate-config`` command for details.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment