chef-metal-fog 0.5.beta.6 → 0.5

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: 808835083ceaf7db0de62541e834b4730d8ea919
4
- data.tar.gz: d3333babf02cf215c515e78c8167fe9df22b0570
3
+ metadata.gz: ba70e5d354ec37158152081d939429461f6cbcee
4
+ data.tar.gz: d268dfc2afebd4072e31cafb3eb58d3255df80c1
5
5
  SHA512:
6
- metadata.gz: 54d7c00be7001d256832652f8d78865ed2a7eb43fc6e3a273c255aa24dd37d53e020a301067e9fd079d55528a27ca8b967a10b333ef67fe3fe1846523045f3bd
7
- data.tar.gz: c5338a27a82b1d1f750feae7cb72214e064b65cce937b6b69afff0183b3d560f28dbe3567160d90b886a0f61069df683cf12808c1dc0ee2cf6941a531ac3393d
6
+ metadata.gz: 09255981c637779902d5e70fdfb636eefa425807d374d9f81ed54e7d8a4243ce63bd796cb838e78b7653cc53f7ec8e3cd96c6412315879bef24f654507fc09b7
7
+ data.tar.gz: 5d2d21cf7f9a3d76513034c11d78e54a4a578b9ddcde859cf14048fcaa04d44a3c207274097bfd8a7b38ef1048a955fa06bfc72f13db6626a977e31d53565609
@@ -81,8 +81,10 @@ class Chef::Provider::FogKeyPair < Chef::Provider::LWRPBase
81
81
  case new_driver.compute_options[:provider]
82
82
  when 'DigitalOcean'
83
83
  compute.create_ssh_key(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
84
- when 'OpenStack', 'Rackspace'
84
+ when 'OpenStack'
85
85
  compute.create_key_pair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
86
+ when 'Rackspace'
87
+ compute.create_keypair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
86
88
  else
87
89
  compute.key_pairs.get(new_resource.name).destroy
88
90
  compute.import_key_pair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
@@ -101,8 +103,10 @@ class Chef::Provider::FogKeyPair < Chef::Provider::LWRPBase
101
103
  case new_driver.compute_options[:provider]
102
104
  when 'DigitalOcean'
103
105
  compute.create_ssh_key(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
104
- when 'OpenStack', 'Rackspace'
106
+ when 'OpenStack'
105
107
  compute.create_key_pair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
108
+ when 'Rackspace'
109
+ compute.create_keypair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
106
110
  else
107
111
  compute.import_key_pair(new_resource.name, Cheffish::KeyFormatter.encode(desired_key, :format => :openssh))
108
112
  end
@@ -3,6 +3,7 @@ require 'chef_metal/machine/windows_machine'
3
3
  require 'chef_metal/machine/unix_machine'
4
4
  require 'chef_metal/machine_spec'
5
5
  require 'chef_metal/convergence_strategy/install_msi'
6
+ require 'chef_metal/convergence_strategy/install_sh'
6
7
  require 'chef_metal/convergence_strategy/install_cached'
7
8
  require 'chef_metal/convergence_strategy/no_converge'
8
9
  require 'chef_metal/transport/ssh'
@@ -117,13 +118,10 @@ module ChefMetalFog
117
118
  def self.from_provider(provider, config)
118
119
  # Figure out the options and merge them into the config
119
120
  config, id = compute_options_for(provider, nil, config)
120
- driver_options = config[:driver_options] || {}
121
- compute_options = driver_options[:compute_options] || {}
122
121
 
123
122
  driver_url = "fog:#{provider}:#{id}"
124
123
 
125
- config = ChefMetal.config_for_url(driver_url, config)
126
- FogDriver.new(driver_url, config)
124
+ ChefMetal.driver_for_url(driver_url, config)
127
125
  end
128
126
 
129
127
  # Create a new fog driver.
@@ -479,8 +477,10 @@ module ChefMetalFog
479
477
 
480
478
  if machine_spec.location['is_windows']
481
479
  ChefMetal::ConvergenceStrategy::InstallMsi.new(machine_options[:convergence_options], config)
482
- else
480
+ elsif machine_options[:cached_installer] == true
483
481
  ChefMetal::ConvergenceStrategy::InstallCached.new(machine_options[:convergence_options], config)
482
+ else
483
+ ChefMetal::ConvergenceStrategy::InstallSh.new(machine_options[:convergence_options], config)
484
484
  end
485
485
  end
486
486
 
@@ -590,9 +590,9 @@ module ChefMetalFog
590
590
  when 'AWS'
591
591
  # Grab the profile
592
592
  aws_profile = FogDriverAWS.get_aws_profile(result[:driver_options], id)
593
- [ :aws_access_key_id, :aws_secret_access_key, :aws_security_token].each do |key|
594
- new_compute_options[key] = aws_profile[key]
595
- end
593
+ new_compute_options[:aws_access_key_id] = aws_profile[:aws_access_key_id]
594
+ new_compute_options[:aws_secret_access_key] = aws_profile[:aws_secret_access_key]
595
+ new_compute_options[:aws_session_token] = aws_profile[:aws_security_token]
596
596
  # For :region, we prefer the region in compute options or URL over the region in the profile.
597
597
  new_compute_options[:region] ||= aws_profile[:region] if aws_profile.has_key?(:region) && !compute_options.has_key?(:region)
598
598
  when 'OpenStack'
@@ -606,7 +606,7 @@ module ChefMetalFog
606
606
  new_compute_options[:openstack_auth_url] ||= credential[:openstack_auth_url]
607
607
  new_compute_options[:openstack_tenant] ||= credential[:openstack_tenant]
608
608
  when 'Rackspace'
609
- credential = Fog.credential
609
+ credential = Fog.credentials
610
610
 
611
611
  new_compute_options[:rackspace_username] ||= credential[:rackspace_username]
612
612
  new_compute_options[:rackspace_api_key] ||= credential[:rackspace_api_key]
@@ -6,21 +6,22 @@ module ChefMetalFog
6
6
  module FogDriverAWS
7
7
  def self.get_aws_profile(driver_options, aws_account_id)
8
8
  aws_credentials = get_aws_credentials(driver_options)
9
+ compute_options = driver_options[:compute_options] || {}
9
10
 
10
11
  # Order of operations:
11
- # driver_options[:aws_access_key_id] / driver_options[:aws_secret_access_key] / driver_options[:aws_security_token] / driver_options[:region]
12
- # driver_options[:aws_profile]
12
+ # compute_options[:aws_access_key_id] / compute_options[:aws_secret_access_key] / compute_options[:aws_security_token] / compute_options[:region]
13
+ # compute_options[:aws_profile]
13
14
  # ENV['AWS_ACCESS_KEY_ID'] / ENV['AWS_SECRET_ACCESS_KEY'] / ENV['AWS_SECURITY_TOKEN'] / ENV['AWS_REGION']
14
15
  # ENV['AWS_PROFILE']
15
16
  # ENV['DEFAULT_PROFILE']
16
17
  # 'default'
17
- aws_profile = if driver_options[:aws_access_key_id]
18
+ aws_profile = if compute_options[:aws_access_key_id]
18
19
  Chef::Log.debug("Using AWS driver access key options")
19
20
  {
20
- :aws_access_key_id => driver_options[:aws_access_key_id],
21
- :aws_secret_access_key => driver_options[:aws_secret_access_key],
22
- :aws_security_token => driver_options[:aws_security_token],
23
- :region => driver_options[:region]
21
+ :aws_access_key_id => compute_options[:aws_access_key_id],
22
+ :aws_secret_access_key => compute_options[:aws_secret_access_key],
23
+ :aws_security_token => compute_options[:aws_session_token],
24
+ :region => compute_options[:region]
24
25
  }
25
26
  elsif driver_options[:aws_profile]
26
27
  Chef::Log.debug("Using AWS profile #{driver_options[:aws_profile]}")
@@ -1,3 +1,3 @@
1
1
  module ChefMetalFog
2
- VERSION = '0.5.beta.6'
2
+ VERSION = '0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-metal-fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.beta.6
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-03 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -114,9 +114,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">"
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 1.3.1
119
+ version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
122
  rubygems_version: 2.2.2