Configure logrotation.
None.
logrotate_targets
: Configure log rotation targets and options (dict, default:{}
)logrotate_package_list_state
: Wheter packages are stateinstalled
orlatest
(string, default:installed
)
logrotate_targets
allow to configure logrotation for any number of files per
dictionary key. Each logrotate_targets key supports all options from logrotate
(man 5 logrotate.conf
) with the options
list.
Generated templates are verified with logrotate -d %s
before they are
copied to the logrotate.d directory.
logrotate_targets:
- name: foobar
files:
- /var/log/foo/*.log
- /var/log/bar/*.log
options:
- "rotate 7"
- daily
- missingok
- notifempty
- compress
...
Configuring a file name/pattern only results in the following logrotate configuration:
logrotate_targets:
- name: foobar
files:
- /var/log/foo/bar*.log
/var/log/foo/bar*.log
{
rotate 7
daily
missingok
notifempty
compress
}
None.
- hosts: all
roles:
- { role: ansible-logrotate }
Apache Version 2.0
This role provides integration tests using the Ruby RSpec/serverspec framework with a few drawbacks at the time of writing this documentation.
- Currently supports ansible_os_family == 'Debian' only.
Running integration tests requires a number of dependencies being installed. As this role uses Ruby RSpec there is the need to have Ruby with rake and bundler available.
# install role specific dependencies with bundler
bundle install
# run the complete test suite with Docker
rake suite
# run the complete test suite with Vagrant
RAKE_ANSIBLE_USE_VAGRANT=1 rake suite
Mark Kusch @silpion.de mark.kusch