]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/openssh/recipes/default.rb
Mark the automatic and manual sections of the known hosts file
[chef.git] / cookbooks / openssh / recipes / default.rb
index 13bc8f517d07a3d4e5897290e172b5397b0ca1eb..06a88e8b5613a9d8a31b353c2ef37f0b3e158f2e 100644 (file)
@@ -23,6 +23,15 @@ include_recipe "networking"
 package "openssh-client"
 package "openssh-server"
 
+template "/etc/ssh/sshd_config.d/chef.conf" do
+  source "sshd_config.conf.erb"
+  owner "root"
+  group "root"
+  mode "644"
+  notifies :restart, "service[ssh]"
+  only_if { Dir.exist?("/etc/ssh/sshd_config.d") }
+end
+
 service "ssh" do
   action [:enable, :start]
   supports :status => true, :restart => true, :reload => true
@@ -64,7 +73,7 @@ end
 
 template "/etc/ssh/ssh_known_hosts" do
   source "ssh_known_hosts.erb"
-  mode 0o444
+  mode "444"
   owner "root"
   group "root"
   backup false