Skip to content

Commit

Permalink
Sort hashes in templates so config files are not modified in every pu…
Browse files Browse the repository at this point in the history
…ppet run (and so, ssh is not restarted without need)
  • Loading branch information
amateo committed Feb 27, 2014
2 parents 80d4403 + 3fe49d0 commit db17c3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions templates/ssh_config.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# File managed by Puppet

<%- scope.lookupvar('ssh::client::merged_options').each do |k, v| -%>
<%- scope.lookupvar('ssh::client::merged_options').sort.each do |k, v| -%>
<%- if v.is_a?(Hash) -%>
<%= k %>
<%- v.each do |key, value| -%>
<%- v.sort.each do |key, value| -%>
<%- if value.is_a?(Array) -%>
<%- value.each do |a| -%>
<%= key %> <%= a %>
Expand Down
4 changes: 2 additions & 2 deletions templates/sshd_config.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# File is managed by Puppet

<%- scope.lookupvar('ssh::server::merged_options').each do |k, v| -%>
<%- scope.lookupvar('ssh::server::merged_options').sort.each do |k, v| -%>
<%- if v.is_a?(Hash) -%>
<%= k %>
<%- v.each do |key, value| -%>
<%- v.sort.each do |key, value| -%>
<%- if value.is_a?(Array) -%>
<%- value.each do |a| -%>
<%= key %> <%= a %>
Expand Down

0 comments on commit db17c3d

Please sign in to comment.