Sort config hashes so we dont write unnecessary changes
diff --git a/templates/config.pl.erb b/templates/config.pl.erb
index e5a1a51..ba137af 100644
--- a/templates/config.pl.erb
+++ b/templates/config.pl.erb
@@ -68,8 +68,8 @@
 $Conf{BlackoutPeriods} = [
 <% @blackout_periods.each do |period| -%>
 <% if period.is_a?(Hash) -%>{
-<% period.each_pair do |key,value| -%>
-  <%= key %>  => <% if value.is_a?(Array) %>[<%= value.join(', ') %>]<% else %><%= value %><% end %>,
+<% period.keys.sort.each do |key| -%>
+  <%= key %>  => <% if period[key].is_a?(Array) %>[<%= period[key].join(', ') %>]<% else %><%= period[key] %><% end %>,
 <% end -%>
 },
 <% end -%>
diff --git a/templates/host.pl.erb b/templates/host.pl.erb
index e842221..3732a1b 100644
--- a/templates/host.pl.erb
+++ b/templates/host.pl.erb
@@ -42,8 +42,8 @@
 <% if !@backup_files_only.empty? -%>
 <% if @backup_files_only.is_a?(Hash) -%>
 $Conf{BackupFilesOnly} = {
-<% @backup_files_only.each_pair do |key,value| -%>
-  '<%= key %>'  => <% if value.is_a?(Array) %>['<%= value.join("', '") %>']<% else %><%= value %><% end %>,
+<% @backup_files_only.keys.sort.each do |key| -%>
+  '<%= key %>'  => <% if @backup_files_only[key].is_a?(Array) %>['<%= @backup_files_only[key].join("', '") %>']<% else %><%= @backup_files_only[key] %><% end %>,
 <% end -%>
 };
 <% elsif @backup_files_only.is_a?(Array) -%>
@@ -55,8 +55,8 @@
 <% if !@backup_files_exclude.empty? -%>
 <% if @backup_files_exclude.is_a?(Hash) -%>
 $Conf{BackupFilesExclude} = {
-<% @backup_files_exclude.each_pair do |key,value| -%>
-  '<%= key %>'  => <% if value.is_a?(Array) %>['<%= value.join("', '") %>']<% else %><%= value %><% end %>,
+<% @backup_files_exclude.keys.sort.each do |key| -%>
+  '<%= key %>'  => <% if @backup_files_exclude[key].is_a?(Array) %>['<%= @backup_files_exclude[key].join("', '") %>']<% else %><%= @backup_files_exclude[key] %><% end %>,
 <% end -%>
 };
 <% elsif @backup_files_exclude.is_a?(Array) -%>