ageres210784.logrotate
Rol de Ansible: logrotate
Descripción
Instala y configura logrotate.
Instalación
ansible-galaxy install arillso.logrotate
Requisitos
Ninguno.
Variables del rol
incluir archivos
Ruta a los archivos incluidos.
logrotate_include_dir: /etc/logrotate.d
logrotate_global_config
Habilitar/deshabilitar la configuración global de /etc/logrotate.conf
.
logrotate_global_config: true
logrotate_use_hourly_rotation
Habilitar/deshabilitar la rotación horaria con cron.
logrotate_use_hourly_rotation: false
Habilitar la rotación horaria con systemd para Ubuntu >= focal. logrotate_use_hourly_rotation debe ser true.
logrotate_timer:
options:
- OnCalendar=hourly
- Persistent=true
opciones de logrotate
Lista de opciones globales.
logrotate_options:
- weekly
- rotate 4
- create
- dateext
- su root syslog
Paquete
Nombre del paquete para instalar logrotate
.
logrotate_package: logrotate
configuración por defecto
Logrotate para wtmp
:
logrotate_wtmp_enable: true
logrotate_wtmp:
logs:
- /var/log/wtmp
options:
- missingok
- monthly
- create 0664 root utmp
- rotate 1
Logrotate para btmp
:
logrotate_btmp_enable: true
logrotate_btmp:
logs:
- /var/log/btmp
options:
- missingok
- monthly
- create 0660 root utmp
- rotate 1
Configuración de aplicaciones
Se pueden agregar más archivos de registro que serán rotados.
logrotate_applications: []
Ejemplo
Las siguientes opciones están disponibles.
logrotate_applications:
- name: name-your-log-rotate-application
definitions:
- logs:
- /var/log/apt/term.log
- /var/log/apt/history.log
options:
- su user group
- rotate 12
- monthly
- missingok
- notifempty
postrotate:
- /path/to/some/script
Dependencias
Ninguna
Ejemplo de Playbook
- hosts: all
roles:
- arillso.logrotate
Autor
Licencia
Este proyecto está bajo la Licencia MIT. Consulta el archivo LICENSE para el texto completo de la licencia.
Copyright
(c) 2019, Arillso
Acerca del proyecto
Ansible role for installs and configures logratet on Linux
Instalar
ansible-galaxy install ageres210784.logrotate
Licencia
mit
Descargas
173
Propietario