chef-provisioning-fog 0.13.1 → 0.13.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aaf6579771b48654165dcc7ede21e3d60c8a80fe
4
- data.tar.gz: 57a93d7417190ba9e5f9b7fdc56e0364e2c654f3
3
+ metadata.gz: 7e8d9aff16a913485687ea30699bc056f40f6550
4
+ data.tar.gz: 00049afa78c2598b84dd90a1fd019dd9655f4c5b
5
5
  SHA512:
6
- metadata.gz: bce04b039918073b474e6d039cf07f0b3d59ff9dc4f4d317a436b46e21d61eaa4cdaeac5b06a126a8cd4034c79a545a5680da0dacc9d8b028704196827452df7
7
- data.tar.gz: 3138f0debc2d93f818fbd7e618db2ae420d85b4c58f066c254d83d400fb3ff4807da5143522739e096a2281ca0333cbc21495e5352ee8590c1fc51c91c47521e
6
+ metadata.gz: b95693417ce3f1791dd1e08ab1448c8250cb6c660aa2df21fe427dc8f0c1a43c927b59e89ca94bbdffe3c0654594a076fce3e0cf2fc21854c56a4666b8d5dc45
7
+ data.tar.gz: cd886bb181cad6dddb995d7bf0abecdf0fadd4df59cf2b9cf9bf5fcf238011a39f74bbb3088c2acbce46fd18f9030e735720d201892586ee4402455b0dadf8af
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # chef-provisioning-fog
2
2
 
3
- This is the Fog driver for Chef Provisioning. It provides EC2, Rackspace, DigitalOcean and Openstack functionality.
3
+ This is the Fog driver for Chef Provisioning. It provides EC2, Rackspace, DigitalOcean, SoftLayer, and Openstack functionality.
@@ -37,25 +37,39 @@ module FogDriver
37
37
  bootstrap_options[:image_distribution] = 'CentOS'
38
38
  bootstrap_options[:image_name] = '6.5 x64'
39
39
  end
40
- matches = compute.images.select { |image| image.distribution == bootstrap_options[:image_distribution] }
41
- matches = matches.select { |image| image.name == bootstrap_options[:image_name] } if bootstrap_options[:image_name]
42
- if matches.empty?
40
+ distributions = compute.images.select { |image| image.distribution == bootstrap_options[:image_distribution] }
41
+ if distributions.empty?
42
+ raise "No images on DigitalOcean with distribution #{bootstrap_options[:image_distribution].inspect}"
43
+ end
44
+ images = distributions.select { |image| image.name == bootstrap_options[:image_name] } if bootstrap_options[:image_name]
45
+ if images.empty?
43
46
  raise "No images on DigitalOcean with distribution #{bootstrap_options[:image_distribution].inspect} and name #{bootstrap_options[:image_name].inspect}"
44
47
  end
45
- bootstrap_options[:image_id] = matches.first.id
48
+ bootstrap_options[:image_id] = images.first.id
46
49
  end
47
50
  if !bootstrap_options[:flavor_id]
48
51
  bootstrap_options[:flavor_name] ||= '512MB'
49
- bootstrap_options[:flavor_id] = compute.flavors.select { |flavor| flavor.name == bootstrap_options[:flavor_name] }.first.id
52
+ flavors = compute.flavors.select do |f|
53
+ f.name == bootstrap_options[:flavor_name]
54
+ end
55
+ if flavors.empty?
56
+ raise "Could not find flavor named '#{bootstrap_options[:flavor_name]}' on #{driver_url}"
57
+ end
58
+ bootstrap_options[:flavor_id] = flavors.first.id
50
59
  end
51
60
  if !bootstrap_options[:region_id]
52
61
  bootstrap_options[:region_name] ||= 'San Francisco 1'
53
- bootstrap_options[:region_id] = compute.regions.select { |region| region.name == bootstrap_options[:region_name] }.first.id
62
+ regions = compute.regions.select { |region| region.name == bootstrap_options[:region_name] }
63
+ if regions.empty?
64
+ raise "Could not find region named '#{bootstrap_options[:region_name]}' on #{driver_url}"
65
+ end
66
+ bootstrap_options[:region_id] = regions.first.id
54
67
  end
55
- found_key = compute.ssh_keys.select { |k| k.name == bootstrap_options[:key_name] }.first
56
- if !found_key
68
+ keys = compute.ssh_keys.select { |k| k.name == bootstrap_options[:key_name] }
69
+ if keys.empty?
57
70
  raise "Could not find key named '#{bootstrap_options[:key_name]}' on #{driver_url}"
58
71
  end
72
+ found_key = keys.first
59
73
  bootstrap_options[:ssh_key_ids] ||= [ found_key.id ]
60
74
 
61
75
  # You don't get to specify name yourself
@@ -0,0 +1,36 @@
1
+ class Chef
2
+ module Provisioning
3
+ module FogDriver
4
+ module Providers
5
+ class SoftLayer < FogDriver::Driver
6
+ Driver.register_provider_class('SoftLayer', FogDriver::Providers::SoftLayer)
7
+
8
+ def creator
9
+ compute_options[:softlayer_username]
10
+ end
11
+
12
+ def self.compute_options_for(provider, id, config)
13
+ new_compute_options = {}
14
+ new_compute_options[:provider] = provider
15
+ new_config = { :driver_options => { :compute_options => new_compute_options }}
16
+ new_defaults = {
17
+ :driver_options => { :compute_options => {} },
18
+ :machine_options => { :bootstrap_options => {} }
19
+ }
20
+ result = Cheffish::MergedConfig.new(new_config, config, new_defaults)
21
+
22
+ credential = Fog.credentials
23
+
24
+ new_compute_options[:softlayer_username] ||= credential[:softlayer_username]
25
+ new_compute_options[:softlayer_api_key] ||= credential[:softlayer_api_key]
26
+
27
+ id = result[:driver_options][:compute_options][:softlayer_auth_url]
28
+
29
+ [result, id]
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
@@ -1,7 +1,7 @@
1
1
  class Chef
2
2
  module Provisioning
3
3
  module FogDriver
4
- VERSION = '0.13.1'
4
+ VERSION = '0.13.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioning-fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.15'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.15'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fog
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +115,7 @@ files:
115
115
  - lib/chef/provisioning/fog_driver/providers/joyent.rb
116
116
  - lib/chef/provisioning/fog_driver/providers/openstack.rb
117
117
  - lib/chef/provisioning/fog_driver/providers/rackspace.rb
118
+ - lib/chef/provisioning/fog_driver/providers/softlayer.rb
118
119
  - lib/chef/provisioning/fog_driver/recipe_dsl.rb
119
120
  - lib/chef/provisioning/fog_driver/version.rb
120
121
  - lib/chef/resource/fog_key_pair.rb
@@ -144,8 +145,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
145
  version: '0'
145
146
  requirements: []
146
147
  rubyforge_project:
147
- rubygems_version: 2.4.2
148
+ rubygems_version: 2.4.5
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: Driver for creating Fog instances in Chef Provisioning.
151
152
  test_files: []
153
+ has_rdoc: