Skip to content

Commit

Permalink
Implement Specific Option Ordering Requirements
Browse files Browse the repository at this point in the history
If the options 'Port' or 'ListenAddress' are specified they are plucked from the options hash and put at the top of the sshd config file with Port befire ListenAddress as is required by the sshd software (having ListenAddress before Port will cause an error).

The rest of the options hash is processed as normal
  • Loading branch information
Chris Portman committed Apr 15, 2014
1 parent 1426c30 commit 86d9048
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/sshd_config.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# File is managed by Puppet
<%- if port = scope.lookupvar('ssh::server::merged_options').delete('Port') -%>
Port <%= port %>
<%- end -%>
<%- if listen = scope.lookupvar('ssh::server::merged_options').delete('ListenAddress') -%>
ListenAddress <%= listen %>
<%- end -%>

<%- scope.lookupvar('ssh::server::merged_options').sort_by{ |sk| (sk.to_s.downcase.include? "match") ? sk.to_s : '' }.each do |k, v| -%>
<%- if v.is_a?(Hash) -%>
Expand Down

0 comments on commit 86d9048

Please sign in to comment.