summaryrefslogtreecommitdiff
path: root/playbook.yml
blob: b7ff57ee63c696e85cf3350985cb8fb4a50b2ee8 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
---
- hosts: all
  gather_facts: false
  become: true
  remote_user: dci
  tasks:
    - name: Ensure custom fact directory exists
      file:
        path: /etc/ansible/facts.d
        recurse: yes
        state: directory

    - name: Install package_detection custom fact
      copy:
        src: facts.d/package_detection.fact
        dest: /etc/ansible/facts.d/package_detection.fact
        mode: 0755

- hosts: all
  remote_user: dci
  tasks:
    - group_by:
        key: '{{ ansible_local.package_detection.httpd_installed }}'

- hosts: prometheus-server
  remote_user: dci
  roles:
    - httpd
    - grafana
    - prometheus-server
    - prometheus-alertmanager
    - prometheus-blackbox-exporter
    - dci-prometheus-server
    - dci-prometheus-alertmanager
    - dci-grafana

- hosts: all
  remote_user: dci
  roles:
    - prometheus-node-exporter

- hosts: httpd
  remote_user: dci
  roles:
    - prometheus-apache-exporter