-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate aufs and device-mapper logic to separate cookbooks, closes #88 …
…and #90
- Loading branch information
Showing
5 changed files
with
43 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,2 @@ | ||
case node['platform'] | ||
when 'ubuntu' | ||
# If aufs isn't available, do our best to install the correct linux-image-extra package. | ||
# Use kernel release for saucy and newer, otherwise use older, more compatible regexp match | ||
if Chef::Version.new(node['platform_version']) < Chef::Version.new('13.10') | ||
# Original method copied from https://github.com/thoward/docker-cookbook/blob/master/recipes/default.rb | ||
package_name = 'linux-image-extra-' + Mixlib::ShellOut.new("uname -r | grep --only-matching -e [0-9]\.[0-9]\.[0-9]-[0-9]*").run_command.stdout.strip | ||
else | ||
# In modern ubuntu versions, kernel release matches the kernel package name | ||
package_name = 'linux-image-extra-' + node['kernel']['release'] | ||
end | ||
|
||
extra_package = Mixlib::ShellOut.new('apt-cache search ' + package_name).run_command.stdout.split(' ').first | ||
# Wait to strip until after checking for empty, to protect against nil errors | ||
unless extra_package.nil? || extra_package.empty? | ||
package extra_package.strip do | ||
not_if 'modprobe -l | grep aufs' | ||
end | ||
end | ||
|
||
modules 'aufs' do | ||
action :load | ||
end | ||
end | ||
# DEPRECATED: will likely be removed in chef-docker 1.0 | ||
include_recipe 'aufs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
# TODO: Move to its own cookbook | ||
|
||
packages = value_for_platform( | ||
%w(centos fedora oracle redhat) => { | ||
'default' => %w(device-mapper device-mapper-devel device-mapper-persistent-data) | ||
}, | ||
%w(debian ubuntu) => { | ||
'default' => %w(libdevmapper1.02.1 libdevmapper-dev) | ||
} | ||
) | ||
|
||
packages.each do |p| | ||
package p | ||
end | ||
# DEPRECATED: will likely be removed in chef-docker 1.0 | ||
include_recipe 'device-mapper' |