aboutsummaryrefslogtreecommitdiffstats
path: root/roles/prometheus/tasks/main.yml
blob: eb60335ea72f4576c3e63f145cb6a6c7ebd3ba50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: Install prometheus
  package:
    name: prometheus
    state: present
  tags:
    - role::prometheus

- name: Configure prometheus command line options
  lineinfile:
    path: /etc/default/prometheus
    regexp: ^ARGS.*
    line: ARGS="{{ prometheus_cmdline_options }}"
  tags:
    - role::prometheus
  when:
    - prometheus_cmdline_options is defined
  notify:
    - Restart the prometheus service

- name: Configure prometheus
  copy:
    content: |
      # Ansible managed
      {{ prometheus_configuration | to_nice_yaml }}
    dest: /etc/prometheus/prometheus.yml
    owner: prometheus
    group: prometheus
    mode: 0400
  tags:
    - role::prometheus
  notify:
    - Reload the prometheus service