summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/tasks/main.yml
blob: 784e872a9075c28361965f9d2adac7a3e5ccc0ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
- name: prepare storage volume for /var/lib/prometheus
  when: prometheus_server_storage is defined
  vars:
    storage_volume: "{{ prometheus_server_storage | combine({'dest': '/var/lib/prometheus'}) }}"
  include_role:
    name: "storage/{{ prometheus_server_storage.type }}/volume"

- name: install apt packages
  apt:
    name: prometheus
    state: present

- name: listen on localhost only
  lineinfile:
    path: /etc/default/prometheus
    regexp: '^ARGS='
    line: 'ARGS="--web.listen-address=127.0.0.1:9090 --storage.tsdb.retention={{ prometheus_server_retention }}"'
  notify: restart prometheus