Commit a80d870 1 parent 6bb5c80 commit a80d870 Copy full SHA for a80d870
File tree 4 files changed +26
-4
lines changed
4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,11 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
42
42
- name : example-delaycompress
43
43
path : " /var/log/example-delaycompress/*.log"
44
44
delaycompress : true
45
- - name : example-script
46
- path : " /var/log/example-script/*.log"
45
+ - name : example-prerotate-script
46
+ path : " /var/log/example-prerotate-script/*.log"
47
+ prerotate : echo "e.g. backup to an offsite location"
48
+ - name : example-postrotate-script
49
+ path : " /var/log/example-postrotate-script/*.log"
47
50
postrotate : killall -HUP some_process_name
48
51
- name : btmp
49
52
path : /var/log/btmp
Original file line number Diff line number Diff line change 29
29
- name : example-delaycompress
30
30
path : " /var/log/example-delaycompress/*.log"
31
31
delaycompress : true
32
- - name : example-script
33
- path : " /var/log/example-script/*.log"
32
+ - name : example-prerotate-script
33
+ path : " /var/log/example-prerotate-script/*.log"
34
+ prerotate : echo "e.g. backup to an offsite location"
35
+ - name : example-postrotate-script
36
+ path : " /var/log/example-postrotate-script/*.log"
34
37
postrotate : killall -HUP some_process_name
35
38
- name : btmp
36
39
path : /var/log/btmp
Original file line number Diff line number Diff line change 127
127
when :
128
128
- item.delaycompress is defined
129
129
130
+ - name : assert | Test prerotate in logrotate_entries
131
+ ansible.builtin.assert :
132
+ that :
133
+ - item.prerotate is string
134
+ - item.prerotate is not none
135
+ quiet : true
136
+ loop : " {{ logrotate_entries }}"
137
+ loop_control :
138
+ label : " {{ item.name }}"
139
+ when :
140
+ - item.prerotate is defined
141
+
130
142
- name : assert | Test postrotate in logrotate_entries
131
143
ansible.builtin.assert :
132
144
that :
Original file line number Diff line number Diff line change 34
34
35
35
{% if item .dateyesterday is defined and item .dateyesterday %} dateyesterday{% endif %}
36
36
37
+ {% if item .prerotate is defined %} prerotate
38
+ {{ item.prerotate }}
39
+ endscript{% endif %}
40
+
37
41
{% if item .postrotate is defined %} postrotate
38
42
{{ item.postrotate }}
39
43
endscript{% endif %}
You can’t perform that action at this time.
0 commit comments