Skip to content

Commit

Permalink
Merge pull request #340 from caskdata/feature/sysctl-compat
Browse files Browse the repository at this point in the history
compatibility fix for sysctl 0.10, which removed default attributes
  • Loading branch information
dereklwood authored Aug 8, 2017
2 parents 3d31491 + bb6f7bb commit cbf6445
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if Chef::VERSION.to_f < 12.0
cookbook 'mingw', '< 1.0'
cookbook 'ohai', '< 4.0'
cookbook 'selinux', '< 1.0'
cookbook 'sysctl', '< 0.10'
cookbook 'windows', '< 2.0'
cookbook 'yum', '< 4.0'
cookbook 'yum-epel', '< 2.0'
Expand All @@ -19,6 +20,7 @@ elsif Chef::VERSION.to_f < 12.5
cookbook 'mingw', '< 2.0'
cookbook 'ohai', '< 5.0'
cookbook 'selinux', '< 1.0'
cookbook 'sysctl', '< 0.10'
cookbook 'windows', '< 3.0'
cookbook 'yum', '< 5.0'
elsif Chef::VERSION.to_f < 12.6
Expand Down
3 changes: 1 addition & 2 deletions attributes/zzz_system_tuning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@
###

ports = ports.uniq.sort.to_s.tr(' ', '').tr('[', '').tr(']', '') # De-dupe, Sort, and Stringify
include_attribute 'sysctl'

# net.ipv4.ip_local_reserved_ports setting (COOK-79)
if node['sysctl']['params'].key?('net') && node['sysctl']['params']['net'].key?('ipv4') &&
if node.key?('sysctl') && node['sysctl'].key?('params') && node['sysctl']['params'].key?('net') && node['sysctl']['params']['net'].key?('ipv4') &&
node['sysctl']['params']['net']['ipv4'].key?('ip_local_reserved_ports')
orig = node['sysctl']['params']['net']['ipv4']['ip_local_reserved_ports']
default['sysctl']['params']['net']['ipv4']['ip_local_reserved_ports'] = "#{orig},#{ports}"
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"dependencies": {
"yum": ">= 3.0",
"apt": ">= 2.1.2",
"sysctl": "< 0.10.0",
"dpkg_autostart": ">= 0.0.0",
"selinux": ">= 0.0.0",
"sysctl": ">= 0.0.0",
"ulimit": ">= 0.0.0"
},
"recommendations": {
Expand Down
3 changes: 1 addition & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

depends 'yum', '>= 3.0'
depends 'apt', '>= 2.1.2'
depends 'sysctl', '< 0.10.0'

%w(dpkg_autostart selinux ulimit).each do |cb|
%w(dpkg_autostart selinux sysctl ulimit).each do |cb|
depends cb
end

Expand Down

0 comments on commit cbf6445

Please sign in to comment.