diff --git a/README.md b/README.md index 0b57c824..a637e5bc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Requirements - RHEL/CentOS/Scientific - Fedora - ArchLinux +- FreeBSD Recipes diff --git a/attributes/default.rb b/attributes/default.rb index f233ab30..44ebba18 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -26,12 +26,14 @@ %w{openssh-clients openssh} when "arch","suse" %w{openssh} + when "freebsd" + %w{} else %w{openssh-client openssh-server} end default['openssh']['service_name'] = case node['platform_family'] - when "rhel", "fedora","suse" + when "rhel", "fedora", "suse", "freebsd" "sshd" else "ssh" @@ -44,6 +46,13 @@ "0644" end +default['openssh']['rootgroup'] = case node['platform_family'] + when "freebsd" + "wheel" + else + "root" + end + # ssh config group default['openssh']['client']['host'] = "*" # default['openssh']['client']['forward_agent'] = "no" diff --git a/metadata.rb b/metadata.rb index 26a7b4eb..4da09668 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,7 +8,7 @@ recipe "openssh", "Installs openssh" recipe "openssh::iptables", "Set up iptables to allow SSH inbound" -%w{ redhat centos fedora ubuntu debian arch scientific suse }.each do |os| +%w{ redhat centos fedora ubuntu debian arch scientific suse freebsd }.each do |os| supports os end diff --git a/recipes/default.rb b/recipes/default.rb index c9113c58..90d0875d 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -49,7 +49,7 @@ def listen_addr_for interface, type source "ssh_config.erb" mode '0644' owner 'root' - group 'root' + group node['openssh']['rootgroup'] variables(:settings => node['openssh']['client']) end @@ -67,7 +67,7 @@ def listen_addr_for interface, type source "sshd_config.erb" mode node['openssh']['config_mode'] owner 'root' - group 'root' + group node['openssh']['rootgroup'] variables(:settings => node['openssh']['server']) notifies :restart, "service[ssh]" end