provisionator 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,7 @@ module Provisionator
34
34
  instances = launch_instances
35
35
  wait_for_instances instances
36
36
  register_with_load_balancer instances
37
+ assign_elastic_ip instances.first
37
38
 
38
39
  instances.each do |instance|
39
40
  puts "Launched instance #{instance.id}, status: #{instance.status}, public dns: #{instance.dns_name}, public ip: #{instance.ip_address}"
@@ -42,6 +43,12 @@ module Provisionator
42
43
 
43
44
  private
44
45
 
46
+ def assign_elastic_ip instance
47
+ return unless @options[:elastic_ip]
48
+ puts "Assigning #{@options[:elastic_ip]} to #{instance.id}"
49
+ ec2_client.associate_address instance_id: instance.id, public_ip: @options[:elastic_ip]
50
+ end
51
+
45
52
  def register_with_load_balancer instances
46
53
  if @options[:load_balancer_name]
47
54
  puts "Registering with load balancer..."
@@ -79,6 +86,10 @@ module Provisionator
79
86
  end
80
87
  end
81
88
 
89
+ def ec2_client
90
+ @ec2_client ||= AWS::EC2::Client.new(:ec2_endpoint => @options[:ec2_endpoint])
91
+ end
92
+
82
93
  def ec2
83
94
  @ec2 ||= AWS::EC2.new(:ec2_endpoint => @options[:ec2_endpoint])
84
95
  end
@@ -124,6 +124,7 @@ chown ubuntu:ubuntu /home/ubuntu/.chef_node
124
124
  ln -s $APP_PATH/shared/log $APP_PATH/current/log
125
125
  mkdir $APP_PATH/current/tmp
126
126
  ln -s $APP_PATH/shared/pids/ $APP_PATH/current/tmp/pids
127
+ ln -s $APP_PATH/shared/database.yml $APP_PATH/current/config/
127
128
 
128
129
  <% if @options[:chef_pre_bundle] %>
129
130
  chef-solo -c <%= "#{@chef_dir}/solo.rb" %> -j <%= "#{@chef_dir}/#{@options[:chef_pre_bundle]}.json" %> -l debug
@@ -1,3 +1,3 @@
1
1
  module Provisionator
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: provisionator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -97,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  segments:
99
99
  - 0
100
- hash: 4334713208859455962
100
+ hash: 243336916098036442
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  none: false
103
103
  requirements:
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: 4334713208859455962
109
+ hash: 243336916098036442
110
110
  requirements: []
111
111
  rubyforge_project:
112
112
  rubygems_version: 1.8.23