homeserver/roles/mgrote.ecc-rasdaemon/tasks/main.yml
mg 333793e72f Bugfix: logrotate: Fileowner (#317)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#317
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
2022-01-24 07:53:01 +01:00

62 lines
1.4 KiB
YAML

---
- name: include user tasks
include_tasks: user.yml
- name: install rasdaemon
become: true
ansible.builtin.package:
name:
- rasdaemon
- logrotate
state: present
notify: guess-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
owner: "{{ rasdaemon_user }}"
group: "{{ rasdaemon_user_group }}"
- name: copy logrotate config
become: yes
ansible.builtin.template:
src: logrotate_rasdaemon
dest: /etc/logrotate.d/rasdaemon
owner: root
group: "{{ rasdaemon_user_group }}"
mode: 0644
- name: copy rasdaemon-cron.sh
become: yes
ansible.builtin.template:
src: rasdaemon-cron.sh
dest: "/usr/local/bin/rasdaemon-cron.sh"
mode: a+x
owner: "{{ rasdaemon_user }}"
group: "{{ rasdaemon_user_group }}"
- 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"
user: "{{ rasdaemon_user }}"