Skip to content

Commit

Permalink
Merge pull request #36 from rightscale-cookbooks/ST-1_lvm_gem_issues
Browse files Browse the repository at this point in the history
St 1 lvm gem issues
  • Loading branch information
douglaswth committed May 1, 2015
2 parents d63b6a3 + ea018cc commit 5113dcd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ rs-mysql Cookbook CHANGELOG

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

v1.1.8
------

- Updated lvm cookbook dependency version to 1.3.6.
- Set default filesystem on RHEL 7 platform_family to xfs.

v1.1.7
------

Expand Down
11 changes: 7 additions & 4 deletions attributes/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@
default['rs-mysql']['device']['controller_type'] = nil

# The filesystem to be used on the device
default['rs-mysql']['device']['filesystem'] = 'ext4'
# RHEL 7 and CentOS 7 uses XFS as their default file system.
default['rs-mysql']['device']['filesystem'] =
node['platform_family'] == 'rhel' && node['platform_version'] =~ /^7\./ ? 'xfs' : 'ext4'

# Amount of time (in seconds) to wait for a volume to detach at decommission
default['rs-mysql']['device']['detach_timeout'] = 300

# Whether to destroy volume(s) on decommission
default['rs-mysql']['device']['destroy_on_decommission'] = false

# The additional options/flags to use for the `mkfs` command. If the whole device is formatted, the force (-F) flag
# can be used (on ext4 filesystem) to force the operation. This flag may vary based on the filesystem type.
default['rs-mysql']['device']['mkfs_options'] = '-F'
# The additional options/flags to use for the `mkfs` command. If the whole device is formatted, the force flag
# can be used to force the operation. This flag varies based on the filesystem type.
default['rs-mysql']['device']['mkfs_options'] =
node['rs-mysql']['device']['filesystem'] == 'xfs' ? '-f' : '-F'

# The stripe size to use while creating LVM
default['rs-mysql']['device']['stripe_size'] = 512
Expand Down
18 changes: 10 additions & 8 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
license 'Apache 2.0'
description 'Installs and configures a MySQL server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.7'
version '1.1.8'

depends 'chef_handler', '~> 1.1.6'
depends 'marker', '~> 1.0.1'
depends 'database', '~> 1.5.2'
depends 'mysql', '~> 4.0.18'
depends 'collectd', '~> 1.1.0'
depends 'rightscale_tag', '~> 1.0.2'
depends 'filesystem', '~> 0.9.0'
depends 'lvm', '~> 1.1.0'
depends 'rightscale_volume', '~> 1.2.4'
depends 'rightscale_backup', '~> 1.1.5'
depends 'filesystem', '~> 0.10.0'
depends 'lvm', '~> 1.3.6'
depends 'rightscale_volume', '~> 1.2.7'
depends 'rightscale_backup', '~> 1.1.8'
depends 'dns', '~> 0.1.3'
depends 'git', '~> 4.0.2'

Expand Down Expand Up @@ -108,7 +108,9 @@

attribute 'rs-mysql/device/nickname',
:display_name => 'Device Nickname',
:description => 'Nickname for the device. Example: data_storage',
:description => 'Nickname for the device. rs-mysql::volume uses this for the filesystem label, which is' +
' restricted to 12 characters. If longer than 12 characters, the filesystem label will be set to the' +
' first 12 characters. Example: data_storage',
:default => 'data_storage',
:recipes => ['rs-mysql::volume', 'rs-mysql::stripe', 'rs-mysql::decommission'],
:required => 'recommended'
Expand All @@ -135,8 +137,8 @@

attribute 'rs-mysql/device/filesystem',
:display_name => 'Device Filesystem',
:description => 'The filesystem to be used on the device. Example: ext4',
:default => 'ext4',
:description => 'The filesystem to be used on the device. Defaults are based on OS and determined in' +
' attributes/volume.rb. Example: ext4',
:recipes => ['rs-mysql::volume', 'rs-mysql::stripe'],
:required => 'optional'

Expand Down
2 changes: 2 additions & 0 deletions recipes/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
action [:create, :attach]
end

# Filesystem label must be <= 12 chars
filesystem device_nickname do
label device_nickname[0,12]
fstype node['rs-mysql']['device']['filesystem']
device lazy { node['rightscale_volume'][device_nickname]['device'] }
mkfs_options node['rs-mysql']['device']['mkfs_options']
Expand Down

0 comments on commit 5113dcd

Please sign in to comment.