Skip to content

Commit

Permalink
Merge pull request #26 from rightscale-cookbooks/ST-1_swap_dd_for_rhel71
Browse files Browse the repository at this point in the history
St 1 swap dd for rhel71
  • Loading branch information
douglaswth committed Apr 2, 2015
2 parents 3e49177 + 89a79b7 commit 4c07b8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ rs-base Cookbook CHANGELOG

This file is used to list changes made in each version of the rs-base cookbook.

v1.1.5
------

- 'dd' must run when creating swapfile on RedHat Enterprise Linux 7.1.

v1.1.4
------

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs/Configures rs-base'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.4'
version '1.1.5'

supports "centos"
supports "ubuntu"
Expand Down
4 changes: 2 additions & 2 deletions recipes/swap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
# The swap cookbook expects the size to be in MB. So convert the size in GB to MB.
size_mb = node['rs-base']['swap']['size'].to_i * 1024

# RHEL 7.0 currently fails using an 'fallocate' file as swap which is what is done by the 'swap' community cookbook.
# RHEL 7.* currently fails using an 'fallocate' file as swap which is what is done by the 'swap' community cookbook.
# Following is a workaround to create the file first with 'dd'.
# 'dd' command generated from https://github.com/sethvargo-cookbooks/swap/blob/v0.3.8/libraries/swapfile_provider.rb#L141
if node['platform'] == 'redhat' && node['platform_version'] == '7.0'
if node['platform'] == 'redhat' && node['platform_version'] =~ /^7\./
execute "dd if=/dev/zero of=#{node['rs-base']['swap']['file']} bs=1048576 count=#{size_mb}"
end

Expand Down

0 comments on commit 4c07b8c

Please sign in to comment.