Allow logrotation actions to be string or array
For prerotate, logrotate, firstaction and lastaction is very common to need several lines of commands, making it difficult to pass with a puppet string. Allow this parameter to be either and string or an array to allow this usage. Change-Id: I7451ecc550b50b85c55784ef598f6b45412117fc
This commit is contained in:
parent
a94f089535
commit
f9f02e47d4
@ -3,22 +3,34 @@
|
|||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @prerotate != 'undef' -%>
|
<% if @prerotate != 'undef' -%>
|
||||||
prerotate
|
prerotate
|
||||||
<%= @prerotate %>
|
<%- @prerotate = [@prerotate] unless @prerotate.is_a?(Array) -%>
|
||||||
|
<%- @prerotate.each do |val| -%>
|
||||||
|
<%= val %>
|
||||||
|
<%- end -%>
|
||||||
endscript
|
endscript
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @postrotate != 'undef' -%>
|
<% if @postrotate != 'undef' -%>
|
||||||
postrotate
|
postrotate
|
||||||
<%= @postrotate %>
|
<%- @postrotate = [@postrotate] unless @postrotate.is_a?(Array) -%>
|
||||||
|
<%- @postrotate.each do |val| -%>
|
||||||
|
<%= val %>
|
||||||
|
<%- end -%>
|
||||||
endscript
|
endscript
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @firstaction != 'undef' -%>
|
<% if @firstaction != 'undef' -%>
|
||||||
firstaction
|
firstaction
|
||||||
<%= @firstaction %>
|
<%- @firstaction = [@firstaction] unless @firstaction.is_a?(Array) -%>
|
||||||
|
<%- @firstaction.each do |val| -%>
|
||||||
|
<%= val %>
|
||||||
|
<%- end -%>
|
||||||
endscript
|
endscript
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @lastaction != 'undef' -%>
|
<% if @lastaction != 'undef' -%>
|
||||||
lastaction
|
lastaction
|
||||||
<%= @lastaction %>
|
<%- @lastaction = [@lastaction] unless @lastaction.is_a?(Array) -%>
|
||||||
|
<%- @lastaction.each do |val| -%>
|
||||||
|
<%= val %>
|
||||||
|
<%- end -%>
|
||||||
endscript
|
endscript
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user