Skip to content

Commit

Permalink
[COOK-3644] Add FreeBSD support
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Vargo <[email protected]>
  • Loading branch information
Craig Lewis authored and sethvargo committed Sep 30, 2013
1 parent 94abfd1 commit 2740050
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Requirements
- RHEL/CentOS/Scientific
- Fedora
- ArchLinux
- FreeBSD


Recipes
Expand Down
11 changes: 10 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 2740050

Please sign in to comment.