ubuntu_ami 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3039ba721b7243cce3b8640dd09b159fa5ac8e860c891fb2baca7baa86100c94
4
+ data.tar.gz: 64f805d6a62788653a7908503a3006e73f6f8e77d46c47759574c502469b71d0
5
+ SHA512:
6
+ metadata.gz: 591e7d865f2df1db256f3253242588bc39551c642df87e1010be270b8b6be4273a96574cc051ca604292032a6c51916975d7e640508ad3dbc1a90a4e48dc5665
7
+ data.tar.gz: c7606d65627eb7fa7d509d6495a001c609bff771f83ed11e219c1233b027fe414a971ecbbc269ef2d6a0114771631a3448774c7a29e380c2bba87b242c8e0248
@@ -43,15 +43,31 @@ module KnifePlugins
43
43
  region.gsub(/-1/,'').gsub(/-/,'_')
44
44
  end
45
45
 
46
+ # Identifies the virtualization type as HVM if image is HVM.
47
+ #
48
+ # === Parameters
49
+ # type<String>:: comes from Ubuntu::Ami#virtualization_type
50
+ #
51
+ # === Returns
52
+ # String:: "_hvm" if the #virtualization_type is HVM, otherwise empty.
53
+ def virt_type(type)
54
+ type =~ /hvm/ ? "_hvm" : ''
55
+ end
56
+
46
57
  # Indicates whether a particular image has EBS root volume.
47
58
  #
48
59
  # === Parameters
49
60
  # store<String>:: comes from Ubuntu::Ami#root_store
50
61
  #
51
62
  # === Returns
52
- # String:: "_ebs" if the #root_store is EBS, otherwise empty.
63
+ # String:: "_ebs" if the #root_store is EBS, _ebs_ssd if ebs-ssd,
64
+ # _ebs_io1 if provisioned IOPS, etc. Otherwise empty.
53
65
  def disk_store(store)
54
- store =~ /ebs/ ? "_ebs" : ''
66
+ if store =~ /ebs/
67
+ "_#{store.tr('-', '_')}"
68
+ else
69
+ ''
70
+ end
55
71
  end
56
72
 
57
73
  # Indicates whether the architecture type is a large or small AMI.
@@ -80,8 +96,8 @@ module KnifePlugins
80
96
  # === Returns
81
97
  # String:: The region, arch and root_store (if EBS) concatenated
82
98
  # with underscore (_).
83
- def build_type(region, arch, root_store)
84
- "#{region_fix(region)}_#{size_of(arch)}#{disk_store(root_store)}"
99
+ def build_type(region, arch, root_store, type)
100
+ "#{region_fix(region)}_#{size_of(arch)}#{disk_store(root_store)}#{virt_type(type)}"
85
101
  end
86
102
 
87
103
  # Iterates over the AMIs available for the specified distro.
@@ -94,7 +110,7 @@ module KnifePlugins
94
110
  def list_amis(distro)
95
111
  amis = Hash.new
96
112
  Ubuntu.release(distro).amis.each do |ami|
97
- amis[build_type(ami.region, ami.arch, ami.root_store)] = ami.name
113
+ amis[build_type(ami.region, ami.arch, ami.root_store, ami.virtualization_type)] = ami.name
98
114
  end
99
115
  amis
100
116
  end
@@ -17,6 +17,6 @@
17
17
 
18
18
  class Ubuntu
19
19
  class Ami
20
- VERSION = '0.4.1'
20
+ VERSION = '0.4.2'
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,52 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ubuntu_ami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
5
- prerelease:
4
+ version: 0.4.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Joshua Timberman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-02 00:00:00.000000000 Z
11
+ date: 2018-12-10 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Retrieves AMI information from Canonical's Ubuntu release list.Also provides
15
14
  a knife plugin to retrieve the list.
16
- email: joshua@opscode.com
15
+ email: joshua@chef.io
17
16
  executables: []
18
17
  extensions: []
19
- extra_rdoc_files:
20
- - README.md
21
- - LICENSE
18
+ extra_rdoc_files: []
22
19
  files:
23
20
  - LICENSE
24
- - README.md
25
21
  - lib/chef/knife/ec2_amis_ubuntu.rb
26
- - lib/ubuntu_ami/version.rb
27
22
  - lib/ubuntu_ami.rb
28
- homepage: http://github.com/jtimberman/ubuntu_ami
29
- licenses: []
23
+ - lib/ubuntu_ami/version.rb
24
+ homepage: https://github.com/jtimberman/ubuntu_ami
25
+ licenses:
26
+ - Apache-2.0
27
+ metadata: {}
30
28
  post_install_message:
31
29
  rdoc_options: []
32
30
  require_paths:
33
31
  - lib
34
32
  required_ruby_version: !ruby/object:Gem::Requirement
35
- none: false
36
33
  requirements:
37
- - - ! '>='
34
+ - - ">="
38
35
  - !ruby/object:Gem::Version
39
36
  version: '0'
40
37
  required_rubygems_version: !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
- - - ! '>='
39
+ - - ">="
44
40
  - !ruby/object:Gem::Version
45
41
  version: '0'
46
42
  requirements: []
47
43
  rubyforge_project:
48
- rubygems_version: 1.8.23
44
+ rubygems_version: 2.7.6
49
45
  signing_key:
50
- specification_version: 3
46
+ specification_version: 4
51
47
  summary: Retrieves AMI information from Canonical's Ubuntu release list.
52
48
  test_files: []
data/README.md DELETED
@@ -1,53 +0,0 @@
1
- This gem provides a library for retrieving Canonical's Ubuntu AMI
2
- release list for Amazon EC2.
3
-
4
- It also includes a knife plugin to easily retrieve AMIs for launching
5
- instances with Chef.
6
-
7
- # Usage
8
-
9
- Find an AMI based on criteria:
10
-
11
- ami = Ubuntu.release("lucid").amis.find do |ami|
12
- ami.arch == "amd64" and
13
- ami.root_store == "instance-store" and
14
- ami.region == "us-east-1"
15
- end
16
-
17
- Return certain information about the AMIs:
18
-
19
- Ubuntu.release("lucid").amis.each do |ami|
20
- puts "#{ami.region} #{ami.name} (#{ami.arch}, #{ami.root_store})"
21
- end
22
-
23
- Use the knife plugin with Knife, from Chef. Pass just a distro name
24
- for the list of available AMIs by type:
25
-
26
- knife ec2 amis ubuntu lucid
27
-
28
- The first column will be the available types, and the second is the
29
- associated AMI. Specify the type to return just the AMI.
30
-
31
- knife ec2 amis ubuntu lucid us_east_small
32
-
33
- The type is made up of the region, the architecture size (small for 32
34
- bit, large for 64 bit). If the AMI is an EBS root store, that will be indicated.
35
-
36
- # License and Authors
37
-
38
- Author:: Joshua Timberman (<joshua@housepub.org>)
39
- Author:: Michael Hale (<mike@hales.ws>)
40
-
41
- Copyright:: 2011, Joshua Timberman
42
-
43
- Licensed under the Apache License, Version 2.0 (the "License");
44
- you may not use this file except in compliance with the License.
45
- You may obtain a copy of the License at
46
-
47
- http://www.apache.org/licenses/LICENSE-2.0
48
-
49
- Unless required by applicable law or agreed to in writing, software
50
- distributed under the License is distributed on an "AS IS" BASIS,
51
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52
- See the License for the specific language governing permissions and
53
- limitations under the License.