As per Logrotate Github page: The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal, and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size.
Logrotate can be used to do the following things:
- Rotate a file based on size and time
- Add date to the log file which helps during debugging
- Create new log files with required permissions
- Remove old log files
- Run custom commands before and after log rotation
- Compress log files to save space
playbook.yml is main ansible file which is executed by ansible command.
Steps to execute this project:
- Clone this project on your local machine
- Start your ubuntu instance with port 22 open to be accessed from your local machine
- Update inventory file with correct IP address of an ubuntu instance
- Execute Ansible command mentioned below:
Ansible command: ansible-playbook playbook.yml
More information about ansible can be found here.