]> git.somenet.org - root/pub/somesible.git/blob - roles/base/logrotate/tasks/main.yml
roles/server/nginx/vhost-unified
[root/pub/somesible.git] / roles / base / logrotate / tasks / main.yml
1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 ---
8 - name: install logrotate
9   apt:
10     pkg:
11     - logrotate
12     state: present
13     policy_rc_d: 101
14   tags: "online"
15   ignore_errors: "{{ignore_online_errors | bool}}"
16
17
18 - name: copy logrotate config
19   copy:
20     src: "{{item}}"
21     dest: "/etc/logrotate.conf"
22     mode: 0644
23     owner: "root"
24     group: "root"
25   with_first_found:
26     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/logrotate.conf"
27     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/logrotate.conf"
28     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/logrotate.conf"
29     - "default/logrotate.conf"
30
31
32 - name: copy syslog logrotate config
33   copy:
34     src: "{{item}}"
35     dest: "/etc/logrotate.d/rsyslog"
36     mode: 0644
37     owner: "root"
38     group: "root"
39   with_first_found:
40     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/d.rsyslog"
41     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/d.rsyslog"
42     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/d.rsyslog"
43     - "default/d.rsyslog"
44
45
46 - name: enable and start logrotate.timer
47   include_role: name="base/systemd/enable-and-start"
48   vars:
49     service_name: logrotate.timer