Skip to content

Commit

Permalink
move volumes config to host overrides section to make it consistent w…
Browse files Browse the repository at this point in the history
…ith availability_zone, static_ips
  • Loading branch information
Matt Conway committed Mar 31, 2009
1 parent 4bb573a commit e5d8a68
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
34 changes: 20 additions & 14 deletions generators/vulcanize/templates/base/config/rubber/rubber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,6 @@ security_groups: [default]
# creation, so its good to have some empty ones predefined.
auto_security_groups: true

# OPTIONAL: The volumes to create/assign to instances
# ec2_volumes:
# my_host:
# - size: 100 # size of vol in GBs
# zone: us-east-1a # zone to create volume in, needs to match host's zone
# device: /dev/sdh # OS device to attach volume to
# mount: /mnt/mysql_data # The directory to mount this volume to
# filesystem: ext3 # the filesystem to create on volume
# - size: 10 # size of vol in GBs
# zone: us-east-1a # zone to create volume in, needs to match host's zone
# device: /dev/sdi # OS device to attach volume to
# mount: /mnt/logs # The directory to mount this volume to
# filesystem: ext3 # the filesystem to create on volume

# OPTIONAL: The packages to install on all instances
packages: [build-essential, ruby-full, ruby1.8-dev, rake, irb, subversion]

Expand Down Expand Up @@ -146,6 +132,26 @@ staging_roles: "web,haproxy,app,mysql_master"
# of zones
# availability_zone: us-east-1a

# OPTIONAL: If you want t use Elastic Block Store (EBS) persistent
# volumes, add them to host specific overrides and they will get created
# and assigned to the instance. On initial creation, the volume will get
# attached _and_ formatted, but if your host disapears and you recreate
# it, the volume will only get remounted thereby preserving your data
#
# hosts:
# my_host:
# ec2_volumes:
# - size: 100 # size of vol in GBs
# zone: us-east-1a # zone to create volume in, needs to match host's zone
# device: /dev/sdh # OS device to attach volume to
# mount: /mnt/mysql_data # The directory to mount this volume to
# filesystem: ext3 # the filesystem to create on volume
# - size: 10 # size of vol in GBs
# zone: us-east-1a # zone to create volume in, needs to match host's zone
# device: /dev/sdi # OS device to attach volume to
# mount: /mnt/logs # The directory to mount this volume to
# filesystem: ext3 # the filesystem to create on volume

# OPTIONAL: You can also define your own variables here for use when
# transforming config files, and they will be available in your config
# templates as <%= rubber_env.var_name %>
Expand Down
7 changes: 4 additions & 3 deletions recipes/rubber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,10 @@ def sync_security_groups(groups)
required_task :setup_volumes do
env = rubber_cfg.environment.bind()
ec2 = EC2::Base.new(:access_key_id => env.aws_access_key, :secret_access_key => env.aws_secret_access_key)
volumes = env.ec2_volumes || {}

volumes.each do |host, vol_specs|
host_overrides = env.hosts || {}

host_overrides.each do |host, config|
vol_specs = config['ec2_volumes'] || []
ic = rubber_cfg.instance[host]
vol_specs.each do |vol_spec|
key = "#{host}_#{vol_spec['device']}"
Expand Down

0 comments on commit e5d8a68

Please sign in to comment.