You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB

---
- name: Ensure Prometheus packages are installed
notify: restart_prometheus
ansible.builtin.package:
name: "{{ pilab_prometheus_pkgs }}"
state: latest
- loop:
- image: "{{ pilab_prometheus_engine_image }}"
ports:
- src: "{{ pilab_prometheus_port_prometheus }}"
dest: 9090
volumes:
- tmpl: "{{ role_path }}/templates/prometheus.yml"
src: "{{ pilab_prometheus_path_config }}/prometheus.yml"
dest: /etc/prometheus/prometheus.yml
ansible.builtin.include_role:
name: pilab-role-common
tasks_from: add-service
# https://prometheus.io/docs/instrumenting/exporters/
- name: Ensure node_exporter config is updated
notify: restart_prometheus
loop:
- key: web.listen-address
value: :{{ pilab_prometheus_port_metrics }}
ansible.builtin.lineinfile:
path: /etc/default/prometheus-node-exporter
regexp: --{{ item.key }}=".*"$
line: --{{ item.key }}="{{ item.value }}"