rubber 1.7.2 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG +6 -0
  2. data/VERSION +1 -1
  3. data/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +3 -3
  4. data/generators/vulcanize/templates/base/config/rubber/rubber.yml +8 -0
  5. data/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +2 -2
  6. data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +0 -1
  7. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +1 -0
  8. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +4 -2
  9. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +6 -0
  10. data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +3 -3
  11. data/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +43 -16
  12. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf +7 -0
  13. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +270 -243
  14. data/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +3 -3
  15. data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +44 -5
  16. data/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +222 -43
  17. data/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +5 -0
  18. data/lib/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +3 -3
  19. data/lib/generators/vulcanize/templates/base/config/rubber/rubber.yml +8 -0
  20. data/lib/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +2 -2
  21. data/lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +0 -1
  22. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +1 -0
  23. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +4 -2
  24. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +6 -0
  25. data/lib/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +3 -3
  26. data/lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +43 -16
  27. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf +7 -0
  28. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +270 -243
  29. data/lib/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +3 -3
  30. data/lib/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +44 -5
  31. data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +222 -43
  32. data/lib/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +5 -0
  33. data/lib/rubber/cloud/aws.rb +7 -0
  34. data/lib/rubber/recipes/rubber/instances.rb +8 -0
  35. data/lib/rubber/recipes/rubber/tags.rb +12 -0
  36. data/lib/rubber/recipes/rubber/volumes.rb +5 -4
  37. data/lib/rubber/tag.rb +16 -0
  38. data/lib/rubber/tasks/rubber.rb +1 -1
  39. metadata +14 -10
@@ -0,0 +1,12 @@
1
+ require 'rubber/tag'
2
+
3
+ namespace :rubber do
4
+ desc <<-DESC
5
+ Updates ALL the tags on EC2 instances for the current env
6
+ DESC
7
+ required_task :update_tags do
8
+ rubber_instances.each do |ic|
9
+ Rubber::Tag::update_instance_tags(ic.name)
10
+ end
11
+ end
12
+ end
@@ -96,7 +96,7 @@ namespace :rubber do
96
96
  print "."
97
97
  sleep 2
98
98
  volume = cloud.describe_volumes(vol_id).first
99
- break if volume[:status] == "in-use"
99
+ break if volume[:attachment_status] == "attached"
100
100
  end
101
101
  print "\n"
102
102
 
@@ -161,6 +161,7 @@ namespace :rubber do
161
161
 
162
162
  def zero_partitions(ic, partitions)
163
163
  env = rubber_cfg.environment.bind(ic.role_names, ic.name)
164
+ partitions = partitions.clone
164
165
 
165
166
  # don't zero out the ones that we weren't told to
166
167
  partitions.delete_if do |part|
@@ -194,9 +195,9 @@ namespace :rubber do
194
195
 
195
196
  def setup_raid_volume(ic, raid_spec, create=false)
196
197
  if create
197
- mdadm_init = "mdadm --create #{raid_spec['device']} --level #{raid_spec['raid_level']} --raid-devices #{raid_spec['source_devices'].size} #{raid_spec['source_devices'].sort.join(' ')}"
198
+ mdadm_init = "yes | mdadm --create #{raid_spec['device']} --level #{raid_spec['raid_level']} --raid-devices #{raid_spec['source_devices'].size} #{raid_spec['source_devices'].sort.join(' ')}"
198
199
  else
199
- mdadm_init = "mdadm --assemble #{raid_spec['device']} #{raid_spec['source_devices'].sort.join(' ')}"
200
+ mdadm_init = "yes | mdadm --assemble #{raid_spec['device']} #{raid_spec['source_devices'].sort.join(' ')}"
200
201
  end
201
202
 
202
203
  task :_setup_raid_volume, :hosts => ic.external_ip do
@@ -225,7 +226,7 @@ namespace :rubber do
225
226
  echo "mdadm --assemble --scan" > /etc/rc.local
226
227
  chmod +x /etc/rc.local
227
228
 
228
- #{('yes | mkfs -t ' + raid_spec['filesystem'] + ' ' + raid_spec['device']) if create}
229
+ #{('yes | mkfs -t ' + raid_spec['filesystem'] + ' ' + raid_spec['filesystem_opts'] + ' ' + raid_spec['device']) if create}
229
230
  mkdir -p '#{raid_spec['mount']}'
230
231
  mount '#{raid_spec['mount']}'
231
232
  fi
data/lib/rubber/tag.rb ADDED
@@ -0,0 +1,16 @@
1
+ module Rubber
2
+ module Tag
3
+ # Updates the tags for the given ec2 instance
4
+ def self.update_instance_tags(instance_alias)
5
+ instance_item = Rubber::Configuration.rubber_instances[instance_alias]
6
+ fatal "Instance does not exist: #{instance_alias}" if ! instance_item
7
+
8
+ rubber_cfg = Rubber::Configuration.get_configuration(RUBBER_ENV)
9
+ rubber_env = rubber_cfg.environment.bind()
10
+
11
+ cloud = Rubber::Cloud::get_provider(rubber_env.cloud_provider || "aws", Rubber::Configuration.rubber_env, self)
12
+
13
+ cloud.create_tags(instance_item.instance_id, :Name => instance_alias, :Environment => RUBBER_ENV)
14
+ end
15
+ end
16
+ end
@@ -31,7 +31,7 @@ namespace :rubber do
31
31
  roles = instance.role_names
32
32
  env = cfg.environment.bind(roles, instance_alias)
33
33
  gen = Rubber::Configuration::Generator.new("#{RUBBER_ROOT}/config/rubber", roles, instance_alias)
34
- elsif RUBBER_ENV == 'development'
34
+ elsif ['development', 'test'].include?(Rubber.env)
35
35
  roles = cfg.environment.known_roles
36
36
  role_items = roles.collect do |r|
37
37
  Rubber::Configuration::RoleItem.new(r, r == "db" ? {'primary' => true} : {})
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubber
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 7
9
- - 2
10
- version: 1.7.2
8
+ - 8
9
+ - 0
10
+ version: 1.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Conway
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-29 00:00:00 -04:00
18
+ date: 2010-12-07 00:00:00 -05:00
19
19
  default_executable: vulcanize
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 59
45
+ hash: 25
46
46
  segments:
47
47
  - 0
48
48
  - 9
49
- - 0
50
- version: 0.9.0
49
+ - 17
50
+ version: 0.9.17
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
@@ -240,6 +240,7 @@ files:
240
240
  - generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb
241
241
  - generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab
242
242
  - generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf
243
+ - generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf
243
244
  - generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf
244
245
  - generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf
245
246
  - generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf
@@ -414,6 +415,7 @@ files:
414
415
  - lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb
415
416
  - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/crontab
416
417
  - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/monit-postgresql.conf
418
+ - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf
417
419
  - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf
418
420
  - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql-sysctl.conf
419
421
  - lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf
@@ -465,8 +467,10 @@ files:
465
467
  - lib/rubber/recipes/rubber/setup.rb
466
468
  - lib/rubber/recipes/rubber/spot_requests.rb
467
469
  - lib/rubber/recipes/rubber/static_ips.rb
470
+ - lib/rubber/recipes/rubber/tags.rb
468
471
  - lib/rubber/recipes/rubber/utils.rb
469
472
  - lib/rubber/recipes/rubber/volumes.rb
473
+ - lib/rubber/tag.rb
470
474
  - lib/rubber/tasks/rubber.rb
471
475
  - lib/rubber/util.rb
472
476
  - rails/init.rb
@@ -494,8 +498,8 @@ post_install_message: |+
494
498
 
495
499
  ********************************************************************************
496
500
 
497
- rdoc_options:
498
- - --charset=UTF-8
501
+ rdoc_options: []
502
+
499
503
  require_paths:
500
504
  - lib
501
505
  required_ruby_version: !ruby/object:Gem::Requirement