Skip to content

Instantly share code, notes, and snippets.

@statik
Created September 25, 2012 17:50
Show Gist options
  • Save statik/3783398 to your computer and use it in GitHub Desktop.
Save statik/3783398 to your computer and use it in GitHub Desktop.
diff --git a/cookbooks/openssh/recipes/default.rb b/cookbooks/openssh/recipes/default.rb
index 7fbf435..5c28cc9 100644
--- a/cookbooks/openssh/recipes/default.rb
+++ b/cookbooks/openssh/recipes/default.rb
@@ -38,14 +38,6 @@ template "/etc/ssh/ssh_config" do
variables(:settings => node['openssh']['client'])
end
-template "/etc/ssh/sshd_config" do
- source "sshd_config.erb"
- mode '0644'
- owner 'root'
- group 'root'
- variables(:settings => node['openssh']['server'])
-end
-
service "ssh" do
case node['platform']
when "centos","redhat","fedora","arch","scientific","amazon"
@@ -69,3 +61,11 @@ service "ssh" do
action [ :enable, :start ]
end
+template "/etc/ssh/sshd_config" do
+ source "sshd_config.erb"
+ mode '0644'
+ owner 'root'
+ group 'root'
+ variables(:settings => node['openssh']['server'])
+ notifies :reload, resources(:service => "ssh"), :immediate
+end
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment