Skip to content

Instantly share code, notes, and snippets.

@nickmarden
Created October 20, 2012 01:20
Show Gist options
  • Select an option

  • Save nickmarden/3921602 to your computer and use it in GitHub Desktop.

Select an option

Save nickmarden/3921602 to your computer and use it in GitHub Desktop.
Ironfan.cluster 'my_first_cluster' do
# This is the Chef environment that the Chef nodes
# will be placed under.
environment :dev
# This Chef role comes built in to ironfan. It defines
# certain universal behaviors such as installing ntpd,
# zsh, and (strangely) emacs
role :systemwide
# Life will be difficult without this
role :ssh
# These are behaviors that apply to EC2 resources anywhere
# in the cluster. cloud(:ec2) statements within each facet
# can be used to augment or override these settings
cloud(:ec2) do
permanent true
availability_zones ['us-east-1c', 'us-east-1d']
flavor 't1.micro'
backing 'ebs'
image_name 'ironfan-natty'
chef_client_script 'client.rb'
security_group(:ssh).authorize_port_range(22..22)
mount_ephemerals
end
facet :web do
instances 2
recipe 'nginx'
cloud(:ec2) do
flavor 'm1.small'
# Adds a new security group called "web"
# Only servers in this facet will be added
# to that group
security_group(:web) do
authorize_port_range(80..80)
authorize_port_range(443..443)
end
end
end
facet :database do
instances 1
recipe 'mysql'
cloud(:ec2) do
flavor 'm1.large'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment