Skip to content

Commit

Permalink
Add maxsize.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Apr 26, 2024
1 parent 4d1ecbf commit 3553701
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
create_user: root
create_group: utmp
minsize: 1M
maxsize: 128M
dateext: true
dateformat: "-%Y%m%d"
keep: 1
Expand Down
1 change: 1 addition & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
create_user: root
create_group: utmp
minsize: 1M
maxsize: 128M
dateext: true
dateformat: "-%Y%m%d"
keep: 1
Expand Down
12 changes: 12 additions & 0 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@
item.create_user is defined or
item.create_group is defined

- name: assert | Test maxsize in logrotate_entries
ansible.builtin.assert:
that:
- item.maxsize is string
- item.maxsize is not none
quiet: true
loop: "{{ logrotate_entries }}"
loop_control:
label: "{{ item.name }}"
when:
- item.maxsize is defined

- name: assert | Test minsize in logrotate_entries
ansible.builtin.assert:
that:
Expand Down
2 changes: 2 additions & 0 deletions templates/entry.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

{% if item.keep is defined %} rotate {{ item.keep }}{% endif %}

{% if item.maxsize is defined %} maxsize {{ item.maxsize }}{% endif %}

{% if item.minsize is defined %} minsize {{ item.minsize }}{% endif %}

{% if item.missingok is defined and item.missingok %} missingok{% endif %}
Expand Down

0 comments on commit 3553701

Please sign in to comment.