diff --git a/templates/object_apply_notification_to_host.conf.erb b/templates/object_apply_notification_to_host.conf.erb index 8691434..31a30c2 100644 --- a/templates/object_apply_notification_to_host.conf.erb +++ b/templates/object_apply_notification_to_host.conf.erb @@ -26,10 +26,10 @@ apply Notification "<%= @object_notificationname %>" to Host { command = "<%= @command %>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -44,7 +44,7 @@ apply Notification "<%= @object_notificationname %>" to Host { <%- end -%> <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = "<%= value %>" <%- end -%> } diff --git a/templates/object_apply_notification_to_service.conf.erb b/templates/object_apply_notification_to_service.conf.erb index dca40ee..446f9ff 100644 --- a/templates/object_apply_notification_to_service.conf.erb +++ b/templates/object_apply_notification_to_service.conf.erb @@ -29,10 +29,10 @@ apply Notification "<%= @object_notificationname %>" to Service { command = "<%= @command %>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -47,7 +47,7 @@ apply Notification "<%= @object_notificationname %>" to Service { <%- end -%> <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = "<%= value %>" <%- end -%> } diff --git a/templates/object_apply_service_to_host.conf.erb b/templates/object_apply_service_to_host.conf.erb index 867798c..e380810 100644 --- a/templates/object_apply_service_to_host.conf.erb +++ b/templates/object_apply_service_to_host.conf.erb @@ -35,7 +35,7 @@ apply Service "<%= @object_servicename %>" to Host { check_command = "<%= @check_command -%>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> diff --git a/templates/object_checkcommand.conf.erb b/templates/object_checkcommand.conf.erb index 666d3bb..e05a563 100644 --- a/templates/object_checkcommand.conf.erb +++ b/templates/object_checkcommand.conf.erb @@ -27,7 +27,7 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- end -%> <%- if @vars -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- if @env -%> env = { - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_eventcommand.conf.erb b/templates/object_eventcommand.conf.erb index 79459a8..72763c6 100644 --- a/templates/object_eventcommand.conf.erb +++ b/templates/object_eventcommand.conf.erb @@ -27,7 +27,7 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- end -%> <%- if @vars.empty? -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- if @env.empty? != true -%> env = { - <%- @env.each_pair do |key,value| -%> + <%- @env.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_host.conf.erb b/templates/object_host.conf.erb index 3a779c7..c4223fc 100644 --- a/templates/object_host.conf.erb +++ b/templates/object_host.conf.erb @@ -29,10 +29,10 @@ object Host "<%= @object_hostname %>" { groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%- if value.is_a?(Hash) -%> vars.<%= key %> = { - <%- value.each_pair do |subkey,subvalue|-%> + <%- value.sort_by {|subkey,subvalue| subkey}.each do |subkey,subvalue| -%> <%= subkey %> = <%= subvalue %> <%- end -%> } diff --git a/templates/object_idomysqlconnection.conf.erb b/templates/object_idomysqlconnection.conf.erb index cb83b87..c59feb0 100644 --- a/templates/object_idomysqlconnection.conf.erb +++ b/templates/object_idomysqlconnection.conf.erb @@ -45,7 +45,7 @@ object IdoMysqlConnection "mysql-ido" { <%- if @cleanup.empty? != true -%> cleanup = { - <%- @cleanup.each_pair do |key, value| -%> + <%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } @@ -54,4 +54,4 @@ object IdoMysqlConnection "mysql-ido" { <%- if @categories.length != 0 -%> categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %> <%- end -%> -} \ No newline at end of file +} diff --git a/templates/object_idopgsqlconnection.conf.erb b/templates/object_idopgsqlconnection.conf.erb index ae91842..6f4c8fc 100644 --- a/templates/object_idopgsqlconnection.conf.erb +++ b/templates/object_idopgsqlconnection.conf.erb @@ -45,7 +45,7 @@ object IdoPgsqlConnection "pgsql-ido" { <%- if @cleanup.empty? != true -%> cleanup = { - <%- @cleanup.each_pair do |key, value| -%> + <%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } @@ -54,4 +54,4 @@ object IdoPgsqlConnection "pgsql-ido" { <%- if @categories.length != 0 -%> categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %> <%- end -%> -} \ No newline at end of file +} diff --git a/templates/object_notification.conf.erb b/templates/object_notification.conf.erb index ee78d2f..4ec5931 100644 --- a/templates/object_notification.conf.erb +++ b/templates/object_notification.conf.erb @@ -26,10 +26,10 @@ object Notification "<%= @object_notificationname %>" { <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -47,7 +47,7 @@ object Notification "<%= @object_notificationname %>" { <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_notificationcommand.conf.erb b/templates/object_notificationcommand.conf.erb index 73fc8af..3c8e969 100644 --- a/templates/object_notificationcommand.conf.erb +++ b/templates/object_notificationcommand.conf.erb @@ -27,7 +27,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- if @env.empty? != true -%> env = { - <%- @env.each_pair do |key,value| -%> + <%- @env.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_scheduleddowntime.conf.erb b/templates/object_scheduleddowntime.conf.erb index 88e2875..1c0df36 100644 --- a/templates/object_scheduleddowntime.conf.erb +++ b/templates/object_scheduleddowntime.conf.erb @@ -30,7 +30,7 @@ object ScheduledDowntime "<%= @object_scheduleddowntimename %>" { <%- if @ranges.empty? != true -%> ranges = { - <%- @ranges.each_pair do |key, value| -%> + <%- @ranges.sort_by {|key, value| key}.each do |key, value| -%> "<%= key %>" = "<%= value %>" <%- end -%> } diff --git a/templates/object_service.conf.erb b/templates/object_service.conf.erb index 5c5f3b3..95d29b0 100644 --- a/templates/object_service.conf.erb +++ b/templates/object_service.conf.erb @@ -26,7 +26,7 @@ object Service "<%= @object_servicename %>" { groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> diff --git a/templates/object_timeperiod.conf.erb b/templates/object_timeperiod.conf.erb index 4c6e899..7b983b6 100644 --- a/templates/object_timeperiod.conf.erb +++ b/templates/object_timeperiod.conf.erb @@ -23,7 +23,7 @@ object TimePeriod "<%= @object_name %>" { <%- end -%> <%- if @ranges.empty? != true -%> ranges = { - <%- @ranges.each_pair do |key,value| -%> + <%- @ranges.sort_by {|key, value| key}.each do |key, value| -%> "<%= key %>" = "<%= value %>" <%- end -%> } diff --git a/templates/object_user.conf.erb b/templates/object_user.conf.erb index 0965295..d271160 100644 --- a/templates/object_user.conf.erb +++ b/templates/object_user.conf.erb @@ -29,7 +29,7 @@ object User "<%= @object_username %>" { enable_notifications = <%= @enable_notifications %> <%- end %> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> @@ -45,4 +45,4 @@ object User "<%= @object_username %>" { <%- if @states.length != 0 -%> states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>] <%- end -%> -} \ No newline at end of file +}