Skip to content

Instantly share code, notes, and snippets.

@jkeiser
Created February 18, 2015 21:46
Show Gist options
  • Select an option

  • Save jkeiser/2420170ddc6292fd802d to your computer and use it in GitHub Desktop.

Select an option

Save jkeiser/2420170ddc6292fd802d to your computer and use it in GitHub Desktop.
```ruby
# recipes/zones.rb
AVAILABILITY_ZONES.each do |zone|
with_driver "aws::#{zone}" do
aws_subnet "" do
end
aws_vpc "" do
end
machine_image "base_image_#{zone}" do
recipe 'apt'
recipe 'base'
end
machine_image "web_image_#{zone}" do
from_image "base_image_#{zone}"
recipe 'apache2'
recipe 'myapp'
end
with_machine_options convergence_options: ... do
include_recipe "webservers"
end
end
end
```
```ruby
# recipes/webservers.rb
machine 'web1' do
from_image "web_image_#{zone}"
end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment