Files
ansible_role_proxmox_provision/tasks/logrotate.yml
Jose a684702d7f
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 6s
Gitleaks Scan / gitleaks (push) Successful in 5s
ai-reviews / Review PR (pull_request) Successful in 37s
Markdown Lint / markdown-lint (push) Successful in 5s
ansible-lint / Ansible Lint (pull_request) Failing after 6s
Gitleaks Scan / gitleaks (pull_request) Successful in 4s
Markdown Lint / markdown-lint (pull_request) Successful in 5s
refactor ♻️: Refactor logrotate configuration for better organization and maintainability.
This commit refactors the logrotate configuration by installing and customizing policies, replacing the logrotate command with a service restart in handlers, and adding new templates for Proxmox firewall and general logs. This improves the overall structure and manageability of the logrotate settings.
2026-02-12 21:23:13 +01:00

31 lines
744 B
YAML

---
- name: "Proxmox | Ensure logrotate is installed"
ansible.builtin.apt:
name: logrotate
state: present
update_cache: yes
become: true
when: proxmox_logrotate_enabled
- name: logrotate | pve logrotate policy
ansible.builtin.template:
src: pve-logrotate.j2
dest: "/etc/logrotate.d/99-pve-custom"
owner: root
group: root
mode: "0644"
become: true
when: proxmox_logrotate_enabled
notify: Restart logrotate
- name: logrotate | pve-firewall logrotate policy
ansible.builtin.template:
src: pve-firewall-logrotate.j2
dest: "/etc/logrotate.d/99-pve-firewall-custom"
owner: root
group: root
mode: "0644"
become: true
when: proxmox_logrotate_enabled
notify: Restart logrotate