2 # file: roles/prometheus_exporter/tasks/main.yaml
4 - name: Inst - Update Package Cache (APT)
9 - ansible_distribution|lower == 'ubuntu'
13 - name: Inst - Prerequisites
15 name: "{{ packages | flatten(levels=1) }}"
20 - name: Inst - Start a NodeExporter container
23 image: "{{ ne_image }}"
25 restart_policy: "unless-stopped"
31 - "--path.procfs=/host/proc"
32 - "--path.rootfs=/rootfs"
33 - "--path.sysfs=/host/sys"
34 - "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
37 - "/proc:/host/proc:ro"
42 - name: Inst - Create a Config Directory
44 path: "/etc/prometheus/"
48 - prometheus-conf-blackbox-exporter
50 - name: Conf - Prometheus Blackbox Exporter
52 src: "files/blackbox.yml"
53 dest: "/etc/prometheus/blackbox.yml"
55 - prometheus-conf-blackbox-exporter
57 - name: Inst - Start a BlackBoxExporter container
59 name: "BlackBoxExporter"
60 image: "{{ be_image }}"
62 restart_policy: "unless-stopped"
68 - "--config.file=/config/blackbox.yml"
70 - "/etc/prometheus/blackbox.yml:/config/blackbox.yml:ro"