--- - name: Install Prometheus node-exporter apt: update_cache: true name: prometheus-node-exporter register: apt_result retries: 3 until: apt_result is succeeded - name: Activate prometheus-node-exporter service systemd: name: prometheus-node-exporter enabled: yes state: started # Doesn't work on Debian Stretch - name: Make Prometheus node-exporter listen on adm only when: - ansible_lsb.codename == 'buster' lineinfile: path: /etc/default/prometheus-node-exporter regexp: '^ARGS=' line: "ARGS=\"--web.listen-address={{ ansible_hostname }}.adm.auro.re:9100\"" notify: Restart prometheus-node-exporter