--- - name: install the collector script template: src: "textfile-collector-scripts/{{ textfile_collector_name }}.j2" dest: "/usr/local/share/prometheus-node-exporter/{{ textfile_collector_name }}" mode: 0755 - name: install systemd service units loop: - service - timer template: src: "textfile-collector-scripts/{{ textfile_collector_name }}.{{ item }}.j2" dest: "/etc/systemd/system/prometheus-node-exporter_{{ textfile_collector_name }}.{{ item }}" - name: make sure the systemd timer is enabled and started systemd: daemon_reload: yes name: "prometheus-node-exporter_{{ textfile_collector_name }}.timer" state: started enabled: yes