@@ 35,12 35,23 @@
enabled: true
state: started
-- name: add arch textfile cronjob
- ansible.builtin.cron:
- name: prometheus-arch
- state: present
- job: "chronic /usr/local/bin/prometheus_arch.sh"
- special_time: hourly
+- name: Install prometheus-arch service
+ ansible.builtin.copy:
+ src: "{{ item }}"
+ dest: "/etc/systemd/system/{{ item }}"
+ owner: root
+ group: root
+ mode: 0644
+ with_items:
+ - prometheus-arch.service
+ - prometheus-arch.timer
+
+- name: Enable prometheus-arch timer
+ ansible.builtin.systemd:
+ name: prometheus-arch.timer
+ enabled: true
+ state: started
+ daemon_reload: true
- name: allow in firewalld
ansible.posix.firewalld: