2020-08-18 11:57:53 +02:00
|
|
|
- name: Install rasdaemon
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.apt:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- rasdaemon
|
|
|
|
- logrotate
|
|
|
|
state: present
|
|
|
|
notify: labels
|
|
|
|
|
|
|
|
- name: Enable rasdaemon service
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.service:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: rasdaemon
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
- name: Start rasdaemon service
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.service:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: rasdaemon
|
|
|
|
state: started
|
|
|
|
|
|
|
|
- name: Create rasdaemon log
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: /var/log/rasdaemon.log
|
|
|
|
state: touch
|
|
|
|
access_time: preserve
|
|
|
|
modification_time: preserve
|
|
|
|
|
|
|
|
- name: Add rasdaemon Log to be Rotated
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.blockinfile:
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: rasdaemon-cron.sh
|
|
|
|
dest: "/usr/local/bin/rasdaemon-cron.sh"
|
|
|
|
mode: a+x
|
|
|
|
|
|
|
|
- name: create cronjob
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.cron:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: rasdaemon-log
|
|
|
|
state: present
|
|
|
|
job: /usr/local/bin/rasdaemon-cron.sh
|
|
|
|
minute: "5"
|
|
|
|
hour: "4,8,12,16,20,0"
|