homeserver/roles/mgrote.ecc-rasdaemon/tasks/main.yml
Quotengrote 15d783de86
FQCN eingeführt (#70)
* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
2020-11-21 19:41:19 +01:00

66 lines
1.4 KiB
YAML

- name: Install rasdaemon
become: true
ansible.builtin.apt:
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"