Always specify driver first

In general the options for routers and transports are not sensitive
to order, except that private options for drivers must succeed the
driver option.  Therefore, it is customary to put the driver option
first.

To ensure this, we special case the driver option in the template
expansion.

Also, for the remaining options, put them in sorted order so that
the config files do not needlessly change on puppet runs.

Change-Id: Id5c21aeaede4b5d780403b00eeac4f2947d36ffe
This commit is contained in:
James E. Blair 2016-03-10 15:20:24 -08:00
parent 86b5780533
commit ae24f6250d
1 changed files with 16 additions and 6 deletions

View File

@ -562,11 +562,16 @@ begin routers
<% @routers.each do |router| -%>
<% router.each_pair do |name, values| -%>
<%= name %>:
<% values.each_pair do |k, v| -%>
<% if v == true -%>
<% if values.has_key?('driver') -%>
driver = <%= values['driver'] %>
<% end -%>
<% values.keys.sort.each do |k| -%>
<% if k != 'driver' -%>
<% if values[k] == true -%>
<%= k %>
<% else -%>
<%= k %> = <%= v %>
<%= k %> = <%= values[k] %>
<% end -%>
<% end -%>
<% end -%>
<% end -%>
@ -799,11 +804,16 @@ mailman_verp_smtp:
<% @transports.each do |transport| -%>
<% transport.each_pair do |name, values| -%>
<%= name %>:
<% values.each_pair do |k, v| -%>
<% if v == true -%>
<% if values.has_key?('driver') -%>
driver = <%= values['driver'] %>
<% end -%>
<% values.keys.sort.each do |k| -%>
<% if k != 'driver' -%>
<% if values[k] == true -%>
<%= k %>
<% else -%>
<%= k %> = <%= v %>
<%= k %> = <%= values[k] %>
<% end -%>
<% end -%>
<% end -%>
<% end -%>