--- - name: install apt packages apt: name: prometheus-node-exporter state: present ## TODO: add other configs - name: listen on localhost only lineinfile: path: /etc/default/prometheus-node-exporter regexp: '^ARGS=' line: 'ARGS="--web.listen-address=127.0.0.1:9100"' notify: restart prometheus-node-exporter - name: create nginx snippet copy: content: | location = /node { proxy_pass http://127.0.0.1:9100/metrics; } dest: /etc/prometheus-exporter/exporters-available/node # notify: reload nginx - name: enable nginx snippet file: src: /etc/prometheus-exporter/exporters-available/node dest: /etc/prometheus-exporter/exporters-enabled/node state: link # notify: reload nginx