+- name: Inst - Prerequisites
+ package:
+ name: "{{ packages | flatten(levels=1) }}"
+ state: latest
+ tags:
+ - prometheus-inst
+
+- name: Inst - Start a NodeExporter container
+ docker_container:
+ name: "NodeExporter"
+ image: "{{ ne_image }}"
+ state: "started"
+ restart_policy: "unless-stopped"
+ detach: yes
+ ports:
+ - "9100:9100"
+ privileged: yes
+ command:
+ - "--path.procfs=/host/proc"
+ - "--path.rootfs=/rootfs"
+ - "--path.sysfs=/host/sys"
+ - "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
+ volumes:
+ - "/:/rootfs:ro"
+ - "/proc:/host/proc:ro"
+ - "/sys:/host/sys:ro"
+ tags:
+ - prometheus-inst
+
+- name: Inst - Create a Config Directory
+ ansible.builtin.file:
+ path: "/etc/prometheus/"
+ state: "directory"
+ mode: "0755"
+ tags:
+ - prometheus-conf-blackbox-exporter
+