homeserver/roles/mgrote.ecc-rasdaemon/tasks/main.yml
mg e9f78f93eb Ersetze ansible.builtin.apt module durch ansible.builtin.package (#20)
Bugfix: acng

ansible.builtin.apt --> ansible.builtin.package

Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com>
Reviewed-on: mg/ansible#20
Co-Authored-By: mg <michael.grote@posteo.de>
Co-Committed-By: mg <michael.grote@posteo.de>
2021-01-02 10:30:54 +01:00

66 lines
1.4 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: Add rasdaemon Log to be Rotated
become: true
ansible.builtin.blockinfile:
path: /etc/logrotate.d/rasdaemon
state: present
create: yes
owner: root
group: root
mode: 0644
block: |
/var/log/rasdaemon.log {
su root root
create 0640 root root
rotate 4
weekly
compress
missingok
notifempty
dateext
dateyesterday
}
- 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"