2021-03-13 22:11:57 +01:00
|
|
|
---
|
2021-12-12 16:07:35 +01:00
|
|
|
- name: include user tasks
|
|
|
|
include_tasks: user.yml
|
|
|
|
|
|
|
|
- name: install rasdaemon
|
2020-08-18 11:57:53 +02:00
|
|
|
become: true
|
2021-01-02 10:30:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- rasdaemon
|
|
|
|
- logrotate
|
|
|
|
state: present
|
2021-12-12 16:07:35 +01:00
|
|
|
notify: guess-labels
|
2020-08-18 11:57:53 +02:00
|
|
|
|
2021-12-12 16:07:35 +01:00
|
|
|
- name: enable rasdaemon service
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
|
|
|
|
2021-12-12 16:07:35 +01:00
|
|
|
- name: start rasdaemon service
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
|
|
|
|
2021-12-12 16:07:35 +01:00
|
|
|
- name: create rasdaemon log
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2021-12-12 16:07:35 +01:00
|
|
|
owner: "{{ rasdaemon_user }}"
|
|
|
|
group: "{{ rasdaemon_user_group }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
|
2021-03-13 22:11:57 +01:00
|
|
|
- name: copy logrotate config
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: logrotate_rasdaemon
|
|
|
|
dest: /etc/logrotate.d/rasdaemon
|
2021-12-12 16:07:35 +01:00
|
|
|
owner: "{{ rasdaemon_user }}"
|
|
|
|
group: "{{ rasdaemon_user_group }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
mode: 0644
|
|
|
|
|
2021-12-12 16:07:35 +01:00
|
|
|
- name: copy rasdaemon-cron.sh
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2021-12-12 16:07:35 +01:00
|
|
|
owner: "{{ rasdaemon_user }}"
|
|
|
|
group: "{{ rasdaemon_user_group }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
|
|
|
|
- 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"
|
2021-12-12 16:07:35 +01:00
|
|
|
user: "{{ rasdaemon_user }}"
|