Skip to content

Commit

Permalink
Merge pull request arillso#18 from ganto/feature/logrotate_options
Browse files Browse the repository at this point in the history
Fix custom definition of logrotate_options via inventory
  • Loading branch information
sbaerlocher authored Jan 16, 2020
2 parents 9d64511 + 010e6a5 commit ae9119c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).

## Master

### Fixed

- Fix custom definition of logrotate_options via inventory

## 1.5.1

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
# defaults file for arillso.logrotate

# List of global options. If this is empty the default options of the
# distribution are used.
logrotate_options: []

# Path to the imclude files
logrotate_include_dir: /etc/logrotate.d

Expand Down
6 changes: 6 additions & 0 deletions templates/etc/logrotate.conf.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{{ ansible_managed | comment }}

# see "man logrotate" for details
{% if logrotate_options | length > 0 %}
{% for option in logrotate_options %}
{{ option }}
{% endfor %}
{% else %}
{% for option in logrotate_distribution_options | default([]) %}
{{ option }}
{% endfor %}
{% endif %}

# packages drop log rotation information into this directory
include {{ logrotate_include_dir }}
Expand Down
2 changes: 1 addition & 1 deletion vars/CentOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vars file for arillso.logrotate

# List of global options for the different systems.
logrotate_options:
logrotate_distribution_options:
- weekly
- rotate 4
- create
Expand Down
2 changes: 1 addition & 1 deletion vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vars file for arillso.logrotate

# List of global options for the different systems.
logrotate_options:
logrotate_distribution_options:
- weekly
- rotate 4
- create
Expand Down
2 changes: 1 addition & 1 deletion vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vars file for arillso.logrotate

# List of global options for the different systems.
logrotate_options:
logrotate_distribution_options:
- weekly
- rotate 4
- create
Expand Down
2 changes: 1 addition & 1 deletion vars/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vars file for arillso.logrotate

# List of global options for the different systems.
logrotate_options:
logrotate_distribution_options:
- weekly
- rotate 4
- create
Expand Down

0 comments on commit ae9119c

Please sign in to comment.