2020-02-07 13:11:17 +00:00
|
|
|
---
|
2022-02-07 14:03:59 +00:00
|
|
|
- name: 'Log Clean | Verify we keep a minimum of 10 indices'
|
2020-02-07 13:11:17 +00:00
|
|
|
assert:
|
|
|
|
quiet: true
|
|
|
|
that:
|
2022-02-07 14:03:59 +00:00
|
|
|
- logclean_keep_indices >= 10
|
2020-02-07 13:11:17 +00:00
|
|
|
|
|
|
|
- name: 'Log Clean | Create logclean script'
|
|
|
|
template:
|
|
|
|
src: logclean.sh
|
|
|
|
dest: '{{ logclean_script_path }}'
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: 'Log Clean | Create systemd service: {{ logclean_service_name }}'
|
|
|
|
template:
|
|
|
|
src: logclean.service.j2
|
|
|
|
dest: '{{ logclean_service_path }}/{{ logclean_service_name }}.service'
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: 'Log Clean | Create systemd timer: {{ logclean_service_name }}'
|
|
|
|
template:
|
|
|
|
src: logclean.timer.j2
|
|
|
|
dest: '{{ logclean_service_path }}/{{ logclean_service_name }}.timer'
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Reload systemctl
|
|
|
|
command: systemctl daemon-reload
|
|
|
|
|
|
|
|
- name: 'Log Clean | (Re)start fetching service: {{ logclean_service_name }}'
|
|
|
|
service:
|
|
|
|
name: '{{ logclean_service_name }}.service'
|
|
|
|
state: started
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
- name: 'Log Clean | Enable the service timer: {{ logclean_service_name }}'
|
|
|
|
systemd:
|
|
|
|
name: '{{ logclean_service_name }}.timer'
|
|
|
|
state: started
|
|
|
|
enabled: yes
|