--- ## this is overkill since all apt-based machines that are controlled via ansible will have this installed # - name: make sure python-apt is installed # apt: # name: "{{ python_basename }}-apt" # state: present ## TODO: remove this once all hosts have been migrated - name: make sure the systemd timer for apt textfile collector is disabled and stopped systemd: service: prometheus-node-exporter_apt.timer enabled: no state: stopped register: result_systemd_stop failed_when: "result_systemd_stop is failed and 'Could not find the requested service' not in result_systemd_stop.msg" - name: remove files from apt textfile collector loop: - /etc/systemd/system/prometheus-node-exporter_apt.timer - /etc/systemd/system/prometheus-node-exporter_apt.service - /usr/local/share/prometheus-node-exporter/apt - /var/lib/prometheus-node-exporter/textfile-collector/apt.prom file: path: "{{ item }}" state: absent notify: reload systemd ## - name: install the apt_info textfile collector script include_tasks: textfile_collector_generic.yml