summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/base/tasks/main.yml
blob: 5f42867d227b703292b3d6f4199be327c33d0462 (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
---
- name: check if prometheus apt component of spreadspace repo is enabled
  assert:
    msg: "please enable the 'prometheus' component of spreadspace repo using 'spreadspace_apt_repo_components'"
    that:
    - spreadspace_apt_repo_components is defined
    - "'prometheus' in spreadspace_apt_repo_components"

- name: add user for prometheus-exporter
  user:
    name: prometheus-exporter
    system: yes
    home: /nonexistent
    create_home: no

- name: create TLS certificate and key
  import_tasks: tls.yml

- name: configure nginx vhost
  import_role:
    name: nginx/vhost
  vars:
    nginx_vhost:
      name: prometheus-exporter
      content: "{{ lookup('template', 'nginx-vhost.j2') }}"