rig 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,11 +6,11 @@ rig:
6
6
  #
7
7
  #chef:
8
8
  # knife: /path/to/chef/knife.rb
9
- #
10
- # TODO: Figure out the same thing for puppet
9
+
10
+ #TODO: Figure out the same thing for puppet
11
11
 
12
12
  ssh:
13
- # user to connect as, when ssh to server
13
+ # user to connect as, when ssh'ing to server
14
14
  user: root
15
15
 
16
16
  # the account to use if one is not specified
@@ -5,7 +5,7 @@ module Rig
5
5
  attr_reader :balancers
6
6
  attr_reader :name
7
7
  attr_reader :template
8
- attr_reader :ami
8
+ attr_reader :image
9
9
  attr_reader :region
10
10
  attr_reader :flavor
11
11
 
@@ -24,7 +24,7 @@ module Rig
24
24
  :multi => {
25
25
  :groups => %w{app-server db-inqcloud-dev},
26
26
  :instances => [
27
- :harvester => { :flavor => 'c1.large', :count => 3, :ami => "ami-faketest" },
27
+ :harvester => { :flavor => 'c1.large', :count => 3, :image => "ami-faketest" },
28
28
  :queue => { :flavor => 'c1.medium', :count => 3 },
29
29
  :cache => { :flavor => 'm1.medium', :count => 3 },
30
30
  :app => { :flavor => 'c1.large', :count => 3, :balance => true, :primary => true }
@@ -64,6 +64,7 @@ module Rig
64
64
  end
65
65
  end
66
66
 
67
+ #TODO: overall, need better handling for global config, template and local overrides
67
68
  def initialize(name, template=nil, opts={ })
68
69
  @options = {
69
70
  :region => Rig.config.region,
@@ -72,7 +73,9 @@ module Rig
72
73
  @name = name
73
74
  @template = template
74
75
  @region = @options[:region]
75
- @ami = @options[:ami] || Rig.config.ami[@region] || Rig.config.ami
76
+ #TODO: allow global config setting for image (in AWS, the ami)
77
+ @image = @options[:image] # || Rig.config.compute.image[@region] || Rig.config.compute.image
78
+ #TODO: allow global config setting for flavor (in AWS, the size, like: m1.large)
76
79
  @flavor = @options[:flavor] # || Rig.config.flavor[@region] || Rig.config.flavor
77
80
  @servers = []
78
81
  @balancers = []
@@ -89,7 +92,7 @@ module Rig
89
92
  setinstances = []
90
93
  inst.each do |role, tmpl|
91
94
  count = tmpl[:count]
92
- ami = tmpl[:ami] || @ami
95
+ image = tmpl[:image] || @image
93
96
  flavor = tmpl[:flavor] || @flavor
94
97
  keypair = Rig.config.keypair
95
98
  count.times do |i|
@@ -97,7 +100,7 @@ module Rig
97
100
  chef = Rig.config.chef ? true : false
98
101
 
99
102
  o = {
100
- :image_id => ami,
103
+ :image_id => image,
101
104
  :flavor_id => flavor,
102
105
  :key_name => keypair,
103
106
  :groups => tmpl[:groups] || template[:groups],
@@ -33,6 +33,10 @@ module Rig
33
33
  end
34
34
  end
35
35
 
36
+ def template(name)
37
+ #TODO: implement getting template data from file
38
+ end
39
+
36
40
  def get_account
37
41
  return ENV['RIG_ACCOUNT'] if ENV['RIG_ACCOUNT']
38
42
  return Rig.config.default_account if Rig.config.default_account
@@ -3,7 +3,7 @@ unless defined?(Rig::Version)
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 3
6
- TINY = 2
6
+ TINY = 3
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rig
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shawn Catanzarite