From 356f4ec16362e7f3aa9b3cf2344ba7002a523034 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 01/25] Bring our fork up to date with AWS 2.7.0 --- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/README.md mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100644 new mode 100755 From 5bb87e4526d02178934fab805a5bea5938f8fd62 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 02/25] Fixing Raid creation issue with Snapshot_id and adding encryption passthrough --- providers/ebs_raid.rb | 10 +++++++--- resources/ebs_raid.rb | 6 +++++- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 .../cookbooks/aws_test/recipes/instance_monitoring.rb | 0 .../cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 12 files changed, 12 insertions(+), 4 deletions(-) mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/README.md mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index b69137ac..5e9d06b7 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -34,7 +34,9 @@ @new_resource.snapshots, @new_resource.disk_type, @new_resource.disk_piops, - @new_resource.existing_raid) + @new_resource.existing_raid, + @new_resource.disk_encrypted, + @new_resource.disk_kms_key_id) @new_resource.updated_by_last_action(true) end @@ -316,7 +318,7 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid) + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) @@ -343,8 +345,10 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p device "/dev/#{disk_dev_path}" name disk_dev_path action [:create, :attach] - snapshot_id creating_from_snapshot ? snapshots[i - 1] : '' + snapshot_id creating_from_snapshot ? snapshots[i - 1] : nil provider 'aws_ebs_volume' + encrypted disk_encrypted + kms_key_id disk_kms_key_id # set up our data bag info devices[disk_dev_path] = 'pending' diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index 40b522fb..a060a320 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -14,7 +14,9 @@ :mount_point_group, :mount_point_mode, :mount_point_owner, - :snapshots + :snapshots, + :disk_encrypted, + :disk_kms_key_id attribute :aws_access_key, kind_of: String attribute :aws_secret_access_key, kind_of: String @@ -31,3 +33,5 @@ attribute :disk_type, kind_of: String, default: 'standard' attribute :disk_piops, kind_of: Integer, default: 0 attribute :existing_raid, kind_of: [TrueClass, FalseClass] +attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false +attribute :disk_kms_key_id, kind_of: String diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100755 new mode 100644 From b0c28ca5e4416550661748337fbdf770074b3733 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 13 Apr 2015 12:26:25 -0600 Subject: [PATCH 03/25] Updated README.md to include Encryption parameters for ebs_raid --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 837e1ed1..6d42f098 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,10 @@ Attribute Parameters: * `disk_type` - "standard" or "io1" (io1 is the type for IOPS volume) * `disk_piops` - number of Provisioned IOPS to provision per disk, must be > 100 +* `disk_encrypted` - specify if the EBS volumes should be encrypted +* `disk_kms_key_id` - the full ARN of the AWS Key Management Service + (AWS KMS) master key to use when creating the encrypted volumes + (defaults to master key if not specified) ## elastic_ip.rb From 4f9f679019d8d7953b026e6e6eb882d692003e0c Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:15:49 -0600 Subject: [PATCH 04/25] Fixed permissions --- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/README.md mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100755 new mode 100644 From 09436158bac8e5bdbcb822b9e65e0991096aad58 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 05/25] Fixing Raid creation issue with Snapshot_id and adding encryption passthrough --- providers/ebs_raid.rb | 8 ++++++-- resources/ebs_raid.rb | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index d628bd07..fc812bda 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -34,7 +34,9 @@ @new_resource.snapshots, @new_resource.disk_type, @new_resource.disk_piops, - @new_resource.existing_raid) + @new_resource.existing_raid, + @new_resource.disk_encrypted, + @new_resource.disk_kms_key_id) @new_resource.updated_by_last_action(true) end @@ -317,7 +319,7 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid) + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) @@ -347,6 +349,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p action [:create, :attach] snapshot_id creating_from_snapshot ? snapshots[i - 1] : nil provider 'aws_ebs_volume' + encrypted disk_encrypted + kms_key_id disk_kms_key_id # set up our data bag info devices[disk_dev_path] = 'pending' diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index 1d0145f1..eebd0cc3 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -14,7 +14,9 @@ :mount_point_group, :mount_point_mode, :mount_point_owner, - :snapshots + :snapshots, + :disk_encrypted, + :disk_kms_key_id attribute :aws_access_key, kind_of: String attribute :aws_secret_access_key, kind_of: String @@ -32,3 +34,5 @@ attribute :disk_type, kind_of: String, default: 'standard' attribute :disk_piops, kind_of: Integer, default: 0 attribute :existing_raid, kind_of: [TrueClass, FalseClass] +attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false +attribute :disk_kms_key_id, kind_of: String From 742fb620a79d48b15065021e14542cdc1f00124e Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 13 Apr 2015 12:26:25 -0600 Subject: [PATCH 06/25] Updated README.md to include Encryption parameters for ebs_raid --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0428e997..f824dc9c 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,10 @@ Attribute Parameters: * `disk_type` - "standard" or "io1" (io1 is the type for IOPS volume) * `disk_piops` - number of Provisioned IOPS to provision per disk, must be > 100 +* `disk_encrypted` - specify if the EBS volumes should be encrypted +* `disk_kms_key_id` - the full ARN of the AWS Key Management Service + (AWS KMS) master key to use when creating the encrypted volumes + (defaults to master key if not specified) ## elastic_ip.rb From 867a94ddebeb32dc862de1c0477652bcf7eecf9a Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 07/25] Bring our fork up to date with AWS 2.7.0 --- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/README.md mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100644 new mode 100755 From 35e6ddb05f35d789bfd0f55d9be3fe69f1b92f3e Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 15:23:01 -0600 Subject: [PATCH 08/25] Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 --- README.md | 1 + providers/ebs_raid.rb | 24 ++++++++++++++++-------- resources/ebs_raid.rb | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f824dc9c..abe12f2f 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) +* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index fc812bda..78e881d8 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,7 +36,8 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id) + @new_resource.disk_kms_key_id, + @new_resource.hvm) @new_resource.updated_by_last_action(true) end @@ -46,13 +47,15 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix +def find_free_volume_device_prefix(hvm) # Specific to ubuntu 11./12. - vol_dev = 'sdh' +# vol_dev = 'sdh' + vol_dev = 'sdf' begin vol_dev = vol_dev.next - base_device = "/dev/#{vol_dev}1" +# base_device = "/dev/#{vol_dev}1" + hvm ? base_device = "/dev/#{vol_dev} : base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -319,12 +322,12 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix - Chef::Log.debug("vol device prefix is #{disk_dev}") + disk_dev = find_free_volume_device_prefix(hvm) + Chef::Log.debug("vol base device is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -333,7 +336,12 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - disk_dev_path = "#{disk_dev}#{i}" + if hvm + disk_dev_path = disk_dev + base_device = "/dev/#{vol_dev} + else + disk_dev_path = "#{disk_dev}#{i}" + end Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index eebd0cc3..ee1ad560 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,3 +36,4 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String +attribute :hvm, :kind_of => [ TrueClass, FalseClass ], :default => false From db208747ba1dd0b82fb6ff79da53ebbbdde8ee7f Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 16:22:04 -0600 Subject: [PATCH 09/25] Comment cleanup --- providers/ebs_raid.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index 78e881d8..ee4a87b0 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -49,13 +49,11 @@ # sdX style device names. The ones we actually get will be xvdX def find_free_volume_device_prefix(hvm) # Specific to ubuntu 11./12. -# vol_dev = 'sdh' vol_dev = 'sdf' begin vol_dev = vol_dev.next -# base_device = "/dev/#{vol_dev}1" - hvm ? base_device = "/dev/#{vol_dev} : base_device = "/dev/#{vol_dev}1" + hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -338,7 +336,7 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p (1..num_disks).each do |i| if hvm disk_dev_path = disk_dev - base_device = "/dev/#{vol_dev} + disk_dev = disk_dev.next else disk_dev_path = "#{disk_dev}#{i}" end From f57570521bc8fb12b039898e1df0ec2221a703a0 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 16:30:06 -0600 Subject: [PATCH 10/25] Property format standardization --- resources/ebs_raid.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index ee1ad560..be0ac180 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,4 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, :kind_of => [ TrueClass, FalseClass ], :default => false +attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From 48e21e7f21b4817ec6a31ea70c1024bc0722b0bc Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 11/25] Bring our fork up to date with AWS 2.7.0 --- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/README.md mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100644 new mode 100755 From 1740c2329152e922006d799c6b0e043844e68340 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:15:49 -0600 Subject: [PATCH 12/25] Fixed permissions --- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/README.md mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100755 new mode 100644 From a9c73350f3ea67b1f929daf5f9aecc39af4afe85 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 13/25] Fixing Raid creation issue with Snapshot_id and adding encryption passthrough --- providers/ebs_raid.rb | 7 +++++-- resources/ebs_raid.rb | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index ee4a87b0..01a7643a 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,8 +36,7 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id, - @new_resource.hvm) + @new_resource.disk_kms_key_id) @new_resource.updated_by_last_action(true) end @@ -320,7 +319,11 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, +<<<<<<< HEAD level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) +======= + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) +>>>>>>> Fixing Raid creation issue with Snapshot_id and adding encryption passthrough creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index be0ac180..eebd0cc3 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,3 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From 4b7e4c83446e0bad5e23fc5299ea56aa54f25302 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 15:23:01 -0600 Subject: [PATCH 14/25] Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 --- providers/ebs_raid.rb | 11 ++++++++++- resources/ebs_raid.rb | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index 01a7643a..e2f0ed95 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,7 +36,8 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id) + @new_resource.disk_kms_key_id, + @new_resource.hvm) @new_resource.updated_by_last_action(true) end @@ -319,11 +320,15 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, +<<<<<<< HEAD <<<<<<< HEAD level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) ======= level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) >>>>>>> Fixing Raid creation issue with Snapshot_id and adding encryption passthrough +======= + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) +>>>>>>> Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) @@ -339,7 +344,11 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p (1..num_disks).each do |i| if hvm disk_dev_path = disk_dev +<<<<<<< HEAD disk_dev = disk_dev.next +======= + base_device = "/dev/#{vol_dev} +>>>>>>> Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 else disk_dev_path = "#{disk_dev}#{i}" end diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index eebd0cc3..ee1ad560 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,3 +36,4 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String +attribute :hvm, :kind_of => [ TrueClass, FalseClass ], :default => false From 11aa4004094635638241b28d2a28bd28959bb5f2 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 15:24:34 -0600 Subject: [PATCH 15/25] Bumped version to 14.1.0 --- metadata.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/metadata.rb b/metadata.rb index a3d722e8..64c102a9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,6 +5,3 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.7.2' -recipe 'aws', 'Installs the right_aws gem during compile time' -source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) -issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) From a336900cd9caec3b74ad7bed3d9b6c9c44e98f2d Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 16:22:04 -0600 Subject: [PATCH 16/25] Comment cleanup --- providers/ebs_raid.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index e2f0ed95..e27d6e3c 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -320,15 +320,7 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, -<<<<<<< HEAD -<<<<<<< HEAD - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) -======= level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) ->>>>>>> Fixing Raid creation issue with Snapshot_id and adding encryption passthrough -======= - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id, hvm) ->>>>>>> Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) @@ -344,11 +336,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p (1..num_disks).each do |i| if hvm disk_dev_path = disk_dev -<<<<<<< HEAD + base_device = "/dev/#{vol_dev}" disk_dev = disk_dev.next -======= - base_device = "/dev/#{vol_dev} ->>>>>>> Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 else disk_dev_path = "#{disk_dev}#{i}" end From e44412d9d3a6800699fabd34d86685ba88a6700c Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 28 Apr 2015 16:30:06 -0600 Subject: [PATCH 17/25] Property format standardization --- resources/ebs_raid.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index ee1ad560..be0ac180 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,4 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, :kind_of => [ TrueClass, FalseClass ], :default => false +attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From d36629a28242f7efa8494a5fe23a04087829fb95 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 09:57:48 -0600 Subject: [PATCH 18/25] Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 64c102a9..01db86c6 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,4 +4,4 @@ license 'Apache 2.0' description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '2.7.2' +version '14.2.0' From ed4927248e61a0554103ca0a8d6305d16c16adec Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 10:09:11 -0600 Subject: [PATCH 19/25] Missing source/issues urls from metadata --- metadata.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metadata.rb b/metadata.rb index 01db86c6..196c8470 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,3 +5,6 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '14.2.0' +recipe 'aws', 'Installs the right_aws gem during compile time' +source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) +issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) From 07327df64a9f61606dc13ef3528d61853b2a091b Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 10:21:18 -0600 Subject: [PATCH 20/25] Rebase to Current AWS Master --- README.md | 1 - metadata.rb | 2 +- providers/ebs_raid.rb | 21 +++++++-------------- resources/ebs_raid.rb | 1 - 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index abe12f2f..f824dc9c 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,6 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) -* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb diff --git a/metadata.rb b/metadata.rb index 196c8470..a3d722e8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'Apache 2.0' description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '14.2.0' +version '2.7.2' recipe 'aws', 'Installs the right_aws gem during compile time' source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index e27d6e3c..6e64bcb8 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,8 +36,7 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id, - @new_resource.hvm) + @new_resource.disk_kms_key_id @new_resource.updated_by_last_action(true) end @@ -47,13 +46,13 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix(hvm) +def find_free_volume_device_prefix # Specific to ubuntu 11./12. - vol_dev = 'sdf' + vol_dev = 'sdh' begin vol_dev = vol_dev.next - hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" + base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -324,8 +323,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix(hvm) - Chef::Log.debug("vol base device is #{disk_dev}") + disk_dev = find_free_volume_device_prefix + Chef::Log.debug("vol device prefix is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -334,13 +333,7 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - if hvm - disk_dev_path = disk_dev - base_device = "/dev/#{vol_dev}" - disk_dev = disk_dev.next - else - disk_dev_path = "#{disk_dev}#{i}" - end + disk_dev_path = "#{disk_dev}#{i}" Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index be0ac180..eebd0cc3 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,3 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From e34171b965d5e2aa6bd986a1f49717551d0b9258 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 21/25] Bring our fork up to date with AWS 2.7.0 Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Updated README.md to include Encryption parameters for ebs_raid Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Comment cleanup Property format standardization Bring our fork up to date with AWS 2.7.0 Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Bumped version to 14.1.0 Comment cleanup Property format standardization --- README.md | 5 ++++ metadata.rb | 3 --- providers/ebs_raid.rb | 27 +++++++++++++------ resources/ebs_raid.rb | 7 ++++- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 .../cookbooks/aws_test/recipes/default.rb | 0 .../cookbooks/aws_test/recipes/ebs_raid.rb | 0 .../cookbooks/aws_test/recipes/ebs_volume.rb | 0 .../cookbooks/aws_test/recipes/elastic_ip.rb | 0 .../cookbooks/aws_test/recipes/elb.rb | 0 .../aws_test/recipes/instance_monitoring.rb | 0 .../aws_test/recipes/resource_tag.rb | 0 .../cookbooks/aws_test/recipes/s3_file.rb | 0 14 files changed, 30 insertions(+), 12 deletions(-) mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/README.md mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/README.md b/README.md index 0428e997..abe12f2f 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) +* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb @@ -221,6 +222,10 @@ Attribute Parameters: * `disk_type` - "standard" or "io1" (io1 is the type for IOPS volume) * `disk_piops` - number of Provisioned IOPS to provision per disk, must be > 100 +* `disk_encrypted` - specify if the EBS volumes should be encrypted +* `disk_kms_key_id` - the full ARN of the AWS Key Management Service + (AWS KMS) master key to use when creating the encrypted volumes + (defaults to master key if not specified) ## elastic_ip.rb diff --git a/metadata.rb b/metadata.rb index a3d722e8..64c102a9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,6 +5,3 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.7.2' -recipe 'aws', 'Installs the right_aws gem during compile time' -source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) -issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index d628bd07..e27d6e3c 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -34,7 +34,10 @@ @new_resource.snapshots, @new_resource.disk_type, @new_resource.disk_piops, - @new_resource.existing_raid) + @new_resource.existing_raid, + @new_resource.disk_encrypted, + @new_resource.disk_kms_key_id, + @new_resource.hvm) @new_resource.updated_by_last_action(true) end @@ -44,13 +47,13 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix +def find_free_volume_device_prefix(hvm) # Specific to ubuntu 11./12. - vol_dev = 'sdh' + vol_dev = 'sdf' begin vol_dev = vol_dev.next - base_device = "/dev/#{vol_dev}1" + hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -317,12 +320,12 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid) + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix - Chef::Log.debug("vol device prefix is #{disk_dev}") + disk_dev = find_free_volume_device_prefix(hvm) + Chef::Log.debug("vol base device is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -331,7 +334,13 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - disk_dev_path = "#{disk_dev}#{i}" + if hvm + disk_dev_path = disk_dev + base_device = "/dev/#{vol_dev}" + disk_dev = disk_dev.next + else + disk_dev_path = "#{disk_dev}#{i}" + end Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block @@ -347,6 +356,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p action [:create, :attach] snapshot_id creating_from_snapshot ? snapshots[i - 1] : nil provider 'aws_ebs_volume' + encrypted disk_encrypted + kms_key_id disk_kms_key_id # set up our data bag info devices[disk_dev_path] = 'pending' diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index 1d0145f1..be0ac180 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -14,7 +14,9 @@ :mount_point_group, :mount_point_mode, :mount_point_owner, - :snapshots + :snapshots, + :disk_encrypted, + :disk_kms_key_id attribute :aws_access_key, kind_of: String attribute :aws_secret_access_key, kind_of: String @@ -32,3 +34,6 @@ attribute :disk_type, kind_of: String, default: 'standard' attribute :disk_piops, kind_of: Integer, default: 0 attribute :existing_raid, kind_of: [TrueClass, FalseClass] +attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false +attribute :disk_kms_key_id, kind_of: String +attribute :hvm, kind_of: [TrueClass, FalseClass], default: false diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100755 new mode 100644 From 5e8626e05ebc83cceb1a442e3cd994faf26193c6 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 09:57:48 -0600 Subject: [PATCH 22/25] Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0 Missing source/issues urls from metadata Rebase to Current AWS Master Bring our fork up to date with AWS 2.7.0 Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Updated README.md to include Encryption parameters for ebs_raid --- README.md | 1 - metadata.rb | 3 +++ providers/ebs_raid.rb | 21 +++++++-------------- resources/ebs_raid.rb | 1 - 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index abe12f2f..f824dc9c 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,6 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) -* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb diff --git a/metadata.rb b/metadata.rb index 64c102a9..a3d722e8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,3 +5,6 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.7.2' +recipe 'aws', 'Installs the right_aws gem during compile time' +source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) +issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index e27d6e3c..fc812bda 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,8 +36,7 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id, - @new_resource.hvm) + @new_resource.disk_kms_key_id) @new_resource.updated_by_last_action(true) end @@ -47,13 +46,13 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix(hvm) +def find_free_volume_device_prefix # Specific to ubuntu 11./12. - vol_dev = 'sdf' + vol_dev = 'sdh' begin vol_dev = vol_dev.next - hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" + base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -324,8 +323,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix(hvm) - Chef::Log.debug("vol base device is #{disk_dev}") + disk_dev = find_free_volume_device_prefix + Chef::Log.debug("vol device prefix is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -334,13 +333,7 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - if hvm - disk_dev_path = disk_dev - base_device = "/dev/#{vol_dev}" - disk_dev = disk_dev.next - else - disk_dev_path = "#{disk_dev}#{i}" - end + disk_dev_path = "#{disk_dev}#{i}" Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index be0ac180..eebd0cc3 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,3 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From d867c28ca0f3147d58679c72cdc35196125690cd Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 10 Apr 2015 16:08:23 -0600 Subject: [PATCH 23/25] Bring our fork up to date with AWS 2.7.0 Bring our fork up to date with AWS 2.7.0 Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Updated README.md to include Encryption parameters for ebs_raid Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Comment cleanup Property format standardization Bring our fork up to date with AWS 2.7.0 Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Bumped version to 14.1.0 Comment cleanup Property format standardization Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0 Missing source/issues urls from metadata Rebase to Current AWS Master Bring our fork up to date with AWS 2.7.0 Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Updated README.md to include Encryption parameters for ebs_raid Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Updated README.md to include Encryption parameters for ebs_raid Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Comment cleanup Property format standardization Bring our fork up to date with AWS 2.7.0 Fixed permissions Fixing Raid creation issue with Snapshot_id and adding encryption passthrough Pulled code from https://github.com/opscode-cookbooks/aws/pull/99 Bumped version to 14.1.0 Comment cleanup Property format standardization --- README.md | 5 +++++ metadata.rb | 3 --- providers/ebs_raid.rb | 27 +++++++++++++++++++-------- resources/ebs_raid.rb | 7 ++++++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0428e997..abe12f2f 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) +* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb @@ -221,6 +222,10 @@ Attribute Parameters: * `disk_type` - "standard" or "io1" (io1 is the type for IOPS volume) * `disk_piops` - number of Provisioned IOPS to provision per disk, must be > 100 +* `disk_encrypted` - specify if the EBS volumes should be encrypted +* `disk_kms_key_id` - the full ARN of the AWS Key Management Service + (AWS KMS) master key to use when creating the encrypted volumes + (defaults to master key if not specified) ## elastic_ip.rb diff --git a/metadata.rb b/metadata.rb index a3d722e8..64c102a9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,6 +5,3 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.7.2' -recipe 'aws', 'Installs the right_aws gem during compile time' -source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) -issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index d628bd07..e27d6e3c 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -34,7 +34,10 @@ @new_resource.snapshots, @new_resource.disk_type, @new_resource.disk_piops, - @new_resource.existing_raid) + @new_resource.existing_raid, + @new_resource.disk_encrypted, + @new_resource.disk_kms_key_id, + @new_resource.hvm) @new_resource.updated_by_last_action(true) end @@ -44,13 +47,13 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix +def find_free_volume_device_prefix(hvm) # Specific to ubuntu 11./12. - vol_dev = 'sdh' + vol_dev = 'sdf' begin vol_dev = vol_dev.next - base_device = "/dev/#{vol_dev}1" + hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -317,12 +320,12 @@ def attach_volume(disk_dev, volume_id) # If it's not nil, must have exactly elements def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size, - level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid) + level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id) creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix - Chef::Log.debug("vol device prefix is #{disk_dev}") + disk_dev = find_free_volume_device_prefix(hvm) + Chef::Log.debug("vol base device is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -331,7 +334,13 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - disk_dev_path = "#{disk_dev}#{i}" + if hvm + disk_dev_path = disk_dev + base_device = "/dev/#{vol_dev}" + disk_dev = disk_dev.next + else + disk_dev_path = "#{disk_dev}#{i}" + end Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block @@ -347,6 +356,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p action [:create, :attach] snapshot_id creating_from_snapshot ? snapshots[i - 1] : nil provider 'aws_ebs_volume' + encrypted disk_encrypted + kms_key_id disk_kms_key_id # set up our data bag info devices[disk_dev_path] = 'pending' diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index 1d0145f1..be0ac180 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -14,7 +14,9 @@ :mount_point_group, :mount_point_mode, :mount_point_owner, - :snapshots + :snapshots, + :disk_encrypted, + :disk_kms_key_id attribute :aws_access_key, kind_of: String attribute :aws_secret_access_key, kind_of: String @@ -32,3 +34,6 @@ attribute :disk_type, kind_of: String, default: 'standard' attribute :disk_piops, kind_of: Integer, default: 0 attribute :existing_raid, kind_of: [TrueClass, FalseClass] +attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false +attribute :disk_kms_key_id, kind_of: String +attribute :hvm, kind_of: [TrueClass, FalseClass], default: false From 995625c37616195e6ee540ead995fad48b739585 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 09:57:48 -0600 Subject: [PATCH 24/25] # This is a combination of 4 commits. # The first commit's message is: Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0 # This is the 2nd commit message: Missing source/issues urls from metadata # This is the 3rd commit message: Rebase to Current AWS Master # This is the 4th commit message: Bring our fork up to date with AWS 2.7.0 --- README.md | 1 - metadata.rb | 3 +++ providers/ebs_raid.rb | 21 +++++++------------ resources/ebs_raid.rb | 1 - test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 .../cookbooks/aws_test/recipes/default.rb | 0 .../cookbooks/aws_test/recipes/ebs_raid.rb | 0 .../cookbooks/aws_test/recipes/ebs_volume.rb | 0 .../cookbooks/aws_test/recipes/elastic_ip.rb | 0 .../cookbooks/aws_test/recipes/elb.rb | 0 .../aws_test/recipes/instance_monitoring.rb | 0 .../aws_test/recipes/resource_tag.rb | 0 .../cookbooks/aws_test/recipes/s3_file.rb | 0 14 files changed, 10 insertions(+), 16 deletions(-) mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/README.md mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100644 => 100755 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/README.md b/README.md index abe12f2f..f824dc9c 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,6 @@ Attribute Parameters: * `existing_raid` - whether or not to assume the raid was previously assembled on existing volumes (default no) * `encrypted` - specify if the EBS should be encrypted * `kms_key_id` - the full ARN of the AWS Key Management Service (AWS KMS) master key to use when creating the encrypted volume (defaults to master key if not specified) -* `hvm` - if set to true, device names will use the sdX convention instead of sdxX in order to support HVM instances (default false) ## ebs_raid.rb diff --git a/metadata.rb b/metadata.rb index 64c102a9..a3d722e8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,3 +5,6 @@ description 'LWRPs for managing AWS resources' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.7.2' +recipe 'aws', 'Installs the right_aws gem during compile time' +source_url "https://github.com/opscode-cookbooks/aws" if respond_to?(:source_url) +issues_url "https://github.com/opscode-cookbooks/aws/issues" if respond_to?(:issues_url) diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index e27d6e3c..6e64bcb8 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,8 +36,7 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id, - @new_resource.hvm) + @new_resource.disk_kms_key_id @new_resource.updated_by_last_action(true) end @@ -47,13 +46,13 @@ # AWS's volume attachment interface assumes that we're using # sdX style device names. The ones we actually get will be xvdX -def find_free_volume_device_prefix(hvm) +def find_free_volume_device_prefix # Specific to ubuntu 11./12. - vol_dev = 'sdf' + vol_dev = 'sdh' begin vol_dev = vol_dev.next - hvm ? base_device = "/dev/#{vol_dev}" : base_device = "/dev/#{vol_dev}1" + base_device = "/dev/#{vol_dev}1" Chef::Log.info("dev pre trim #{base_device}") end while ::File.exist?(base_device) @@ -324,8 +323,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0) - disk_dev = find_free_volume_device_prefix(hvm) - Chef::Log.debug("vol base device is #{disk_dev}") + disk_dev = find_free_volume_device_prefix + Chef::Log.debug("vol device prefix is #{disk_dev}") raid_dev = find_free_md_device_name Chef::Log.debug("target raid device is #{raid_dev}") @@ -334,13 +333,7 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p # For each volume add information to the mount metadata (1..num_disks).each do |i| - if hvm - disk_dev_path = disk_dev - base_device = "/dev/#{vol_dev}" - disk_dev = disk_dev.next - else - disk_dev_path = "#{disk_dev}#{i}" - end + disk_dev_path = "#{disk_dev}#{i}" Chef::Log.info "Snapshot array is #{snapshots[i - 1]}" creds = aws_creds # cannot be invoked inside the block diff --git a/resources/ebs_raid.rb b/resources/ebs_raid.rb index be0ac180..eebd0cc3 100644 --- a/resources/ebs_raid.rb +++ b/resources/ebs_raid.rb @@ -36,4 +36,3 @@ attribute :existing_raid, kind_of: [TrueClass, FalseClass] attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false attribute :disk_kms_key_id, kind_of: String -attribute :hvm, kind_of: [TrueClass, FalseClass], default: false diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100644 new mode 100755 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100644 new mode 100755 From 9953a01f15308f368dbe7597d6b59193dc4de848 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Tue, 21 Jul 2015 10:56:50 -0600 Subject: [PATCH 25/25] merge Updated README.md to include Encryption parameters for ebs_raid --- providers/ebs_raid.rb | 2 +- test/fixtures/cookbooks/aws_test/README.md | 0 test/fixtures/cookbooks/aws_test/metadata.rb | 0 test/fixtures/cookbooks/aws_test/recipes/default.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb | 0 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb | 0 test/fixtures/cookbooks/aws_test/recipes/elb.rb | 0 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb | 0 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb | 0 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb | 0 11 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/README.md mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/metadata.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/default.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/elb.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb mode change 100755 => 100644 test/fixtures/cookbooks/aws_test/recipes/s3_file.rb diff --git a/providers/ebs_raid.rb b/providers/ebs_raid.rb index 6e64bcb8..fc812bda 100644 --- a/providers/ebs_raid.rb +++ b/providers/ebs_raid.rb @@ -36,7 +36,7 @@ @new_resource.disk_piops, @new_resource.existing_raid, @new_resource.disk_encrypted, - @new_resource.disk_kms_key_id + @new_resource.disk_kms_key_id) @new_resource.updated_by_last_action(true) end diff --git a/test/fixtures/cookbooks/aws_test/README.md b/test/fixtures/cookbooks/aws_test/README.md old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/metadata.rb b/test/fixtures/cookbooks/aws_test/metadata.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/default.rb b/test/fixtures/cookbooks/aws_test/recipes/default.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_raid.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb b/test/fixtures/cookbooks/aws_test/recipes/ebs_volume.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb b/test/fixtures/cookbooks/aws_test/recipes/elastic_ip.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/elb.rb b/test/fixtures/cookbooks/aws_test/recipes/elb.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb b/test/fixtures/cookbooks/aws_test/recipes/instance_monitoring.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb b/test/fixtures/cookbooks/aws_test/recipes/resource_tag.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb b/test/fixtures/cookbooks/aws_test/recipes/s3_file.rb old mode 100755 new mode 100644