homeserver/roles/mgrote.ecc-rasdaemon/tasks/main.yml
mg 0c016ea2b7 logrotate: template statt blockinfile (#39)
Merge branch 'master' into logrotate

cv4

rasdaemon

musterrolle

rechte

restic

sanoid

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#39
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
2021-03-13 22:11:57 +01:00

54 lines
1.2 KiB
YAML

---
- name: Install rasdaemon
become: true
ansible.builtin.package:
name:
- rasdaemon
- logrotate
state: present
notify: labels
- name: Enable rasdaemon service
become: true
ansible.builtin.service:
name: rasdaemon
enabled: true
- name: Start rasdaemon service
become: true
ansible.builtin.service:
name: rasdaemon
state: started
- name: Create rasdaemon log
become: true
ansible.builtin.file:
path: /var/log/rasdaemon.log
state: touch
access_time: preserve
modification_time: preserve
- name: copy logrotate config
become: yes
ansible.builtin.template:
src: logrotate_rasdaemon
dest: /etc/logrotate.d/rasdaemon
owner: root
group: root
mode: 0644
- name: rasdaemon-cron kopieren
become: yes
ansible.builtin.template:
src: rasdaemon-cron.sh
dest: "/usr/local/bin/rasdaemon-cron.sh"
mode: a+x
- name: create cronjob
become: yes
ansible.builtin.cron:
name: rasdaemon-log
state: present
job: /usr/local/bin/rasdaemon-cron.sh
minute: "5"
hour: "4,8,12,16,20,0"