Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fixed generation of invalid sshd_config files when port and listen_address attributes are used. #8

Closed
wants to merge 1 commit into from

3 participants

James Kyle Jesse Adams Seth Vargo
James Kyle

...en port and listen_address are specified order of declaration matters, but the template listed attributes in a random order

Fixed bug where invalid sshd_config files are generated. Particularly…
… when port and listen_address are specified order of declaration matters, but the template listed attributes in a random order
f71ae34
Jesse Adams

Hey @jameskyle! Thank you for supporting the Opscode Cookbooks! Opscode's process has a couple prerequisites before they will merge your contribution. We need to ensure you've completed a Contributor License Agreement (CLA) and a ticket on their ticket tracker for the release workflow. Pull requests are optional, but should always include the ticket number that they're related to for cross-referencing. Please take a moment to review the below wiki page for the appropriate steps:

Seth Vargo
Owner

Ohai! Thank you for the Pull Request.

I'm going to close this due to inactivity, but please reopen if you have more time to work on this issue :smile:!

Seth Vargo sethvargo closed this October 06, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 05, 2012
Fixed bug where invalid sshd_config files are generated. Particularly…
… when port and listen_address are specified order of declaration matters, but the template listed attributes in a random order
f71ae34
This page is out of date. Refresh to see the latest.
2  metadata.rb
@@ -2,7 +2,7 @@
2 2
 maintainer_email  "cookbooks@opscode.com"
3 3
 license           "Apache 2.0"
4 4
 description       "Installs openssh"
5  
-version           "1.1.0"
  5
+version           "1.1.1"
6 6
 
7 7
 recipe "openssh", "Installs openssh"
8 8
 
2  recipes/default.rb
@@ -68,6 +68,6 @@ def listen_addr_for interface, type
68 68
   mode '0644'
69 69
   owner 'root'
70 70
   group 'root'
71  
-  variables(:settings => node['openssh']['server'])
  71
+  variables(:settings => node['openssh']['server'].to_hash)
72 72
   notifies :restart, "service[ssh]"
73 73
 end
11  templates/default/sshd_config.erb
... ...
@@ -1,5 +1,14 @@
1 1
 # Generated by Chef for <%= node['fqdn'] %>
2  
-
  2
+<% if @settings["port"] -%>
  3
+  <% if @settings["port"].kind_of? Array -%>
  4
+      <% @settings["port"].each do |p| %>
  5
+<%=     "Port #{p}" %>
  6
+      <% end -%>
  7
+    <% else -%>
  8
+<%=    "Port #{@settings["port"]}" %>
  9
+  <% end -%>
  10
+  <% @settings.delete "port" -%>
  11
+<% end -%>
3 12
 <% @settings.each do |key, value| -%>
4 13
 <%  if value.kind_of? Array -%>
5 14
 <%    value.each do |item| -%>
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.