]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/ftp/recipes/default.rb
Update formatting of header comments
[chef.git] / cookbooks / ftp / recipes / default.rb
index 21153f4c440f49f1f0adac5db183edf194ae654b..d2c42100c7aee035f1af9b8e1e00789b77f43838 100644 (file)
@@ -1,8 +1,8 @@
 #
-# Cookbook Name:: FTP
+# Cookbook:: FTP
 # Recipe:: default
 #
-# Copyright 2018, OpenStreetMap Foundation
+# Copyright:: 2018, OpenStreetMap Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 #
 
-package "vsftpd"
+package %w[
+  vsftpd
+  libpam-pwdfile
+]
 
 template "/etc/vsftpd.conf" do
   source "vsftpd.conf.erb"
@@ -26,10 +29,18 @@ template "/etc/vsftpd.conf" do
   mode 0o644
 end
 
+template "/etc/pam.d/vsftpd" do
+  source "pam-vsftpd.erb"
+  owner "root"
+  group "root"
+  mode 0o644
+end
+
 service "vsftpd" do
-  action [:enable] # Do not start the service as config may be broken from failed chef run
+  action [:enable, :start]
   supports :status => true, :restart => true, :reload => true
   subscribes :restart, "template[/etc/vsftpd.conf]"
+  subscribes :restart, "template[/etc/pam.d/vsftpd]"
 end
 
 firewall_rule "accept-ftp-tcp" do
@@ -39,4 +50,5 @@ firewall_rule "accept-ftp-tcp" do
   proto "tcp"
   dest_ports "ftp"
   source_ports "-"
+  helper "ftp"
 end