From 911d61494637ad8059725ef0090d114b840c92e3 Mon Sep 17 00:00:00 2001 From: Bernhard Kohler Date: Tue, 10 Feb 2015 15:31:42 -0600 Subject: [PATCH 1/3] removes static options from lvm mounting these options should exist at that attribute level so that users have maximum flexiblity when it comes to how and when they want their ephemeral dirves mounted. --- attributes/default.rb | 6 +++++- recipes/default.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 979d322..da3cd37 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -21,7 +21,11 @@ default['ephemeral_lvm']['filesystem'] = "ext4" # The ephemeral mount point -default['ephemeral_lvm']['mount_point'] = "/mnt/ephemeral" +default['ephemeral_lvm']['mount_point'] = { + location: "/mnt/ephemeral", + options: ["defaults", "noauto"], + pass: 0 +} # The ephemeral volume group name default['ephemeral_lvm']['volume_group_name'] = "vg-data" diff --git a/recipes/default.rb b/recipes/default.rb index 2313ae4..188b7fa 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -46,7 +46,7 @@ logical_volume node['ephemeral_lvm']['logical_volume_name'] do size node['ephemeral_lvm']['logical_volume_size'] filesystem node['ephemeral_lvm']['filesystem'] - mount_point location: node['ephemeral_lvm']['mount_point'], options: ['defaults', 'noauto'], pass: 0 + mount_point node['ephemeral_lvm']['mount_point'] if ephemeral_devices.size > 1 stripes ephemeral_devices.size stripe_size node['ephemeral_lvm']['stripe_size'].to_i From 39e1dcd30a34e2e817c3c17cde85f84c65727631 Mon Sep 17 00:00:00 2001 From: Bernhard Kohler Date: Thu, 16 Apr 2015 10:17:26 -0500 Subject: [PATCH 2/3] migrates mount point options into their own attr maintains current interface --- attributes/default.rb | 6 ++++-- recipes/default.rb | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index da3cd37..c947164 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -21,8 +21,10 @@ default['ephemeral_lvm']['filesystem'] = "ext4" # The ephemeral mount point -default['ephemeral_lvm']['mount_point'] = { - location: "/mnt/ephemeral", +default['ephemeral_lvm']['mount_point'] = "/mnt/ephemeral" + +# The ephemeral mount point options +default['ephemeral_lvm']['mount_point_properties'] = { options: ["defaults", "noauto"], pass: 0 } diff --git a/recipes/default.rb b/recipes/default.rb index 188b7fa..9934f20 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -46,7 +46,9 @@ logical_volume node['ephemeral_lvm']['logical_volume_name'] do size node['ephemeral_lvm']['logical_volume_size'] filesystem node['ephemeral_lvm']['filesystem'] - mount_point node['ephemeral_lvm']['mount_point'] + mount_point node['ephemeral_lvm']['mount_point_properties'].merge( + location: node['ephemeral_lvm']['mount_point'] + ) if ephemeral_devices.size > 1 stripes ephemeral_devices.size stripe_size node['ephemeral_lvm']['stripe_size'].to_i From 974dfcd505818c3ee1ed1cccd2f6f59412235ea9 Mon Sep 17 00:00:00 2001 From: Bernhard Kohler Date: Tue, 12 May 2015 09:42:45 -0500 Subject: [PATCH 3/3] adds attr description to the README and metadata provides documentation for the 'mount_point_properties' attribute. --- README.md | 1 + metadata.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index bd6a542..10364b8 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Place the `ephemeral_lvm::default` in the runlist and the ephemeral devices will * `node['ephemeral_lvm']['filesystem']` - the filesystem to be used on the ephemeral volume. Default: `'ext4'` * `node['ephemeral_lvm']['mount_point']` - the mount point for the ephemeral volume. Default: `'/mnt/ephemeral'` +* `node['ephemeral_lvm']['mount_point_properties']` - the options used when mounting the ephemeral volume. Default: `{options: ['defaults', 'noauto'], pass: 0}` * `node['ephemeral_lvm']['volume_group_name']` - the volume group name for the ephemeral LVM. Default: `'vg-data'` * `node['ephemeral_lvm']['logical_volume_size']` - the size to be used for the ephemeral LVM. Default: `'100%VG'` - This will use all available space in the volume group. * `node['ephemeral_lvm']['logical_volume_name']` - the name of the logical volume for ephemeral LVM. Default: `'ephemeral0'` diff --git a/metadata.rb b/metadata.rb index 215c1ca..d6bf18a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -28,6 +28,13 @@ :recipes => ["ephemeral_lvm::default"], :required => "recommended" +attribute "ephemeral_lvm/mount_point_properties", + :display_name => "Ephemeral LVM Mount Properties", + :description => "The options used when mounting the ephemeral volume", + :default => {:options => ["defaults", "noauto"], :pass => 0}, + :recipes => ["ephemeral_lvm::default"], + :required => "optional" + attribute "ephemeral_lvm/volume_group_name", :display_name => "Ephemeral LVM Volume Group Name", :description => "The volume group name for the ephemeral LVM",