# = Rudy # # This is an example Rudy configuration. # # Rudy automatically looks for configuration files in the # following locations (in this order): # # ./.rudy/config # ~/.rudy/config # # ./Rudyfile # ./config/rudy/*.rb # ./.rudy/*.rb # /etc/rudy/*.rb # # When multuple files are found, the configuration is # NOT OVERRIDDEN. It's ADDED / APPENDED. This means you can # split configuration across many files as you please. # # There are three sections: accounts, defaults, machines, and routines. # # By convention, accounts and defaults go in ~/.rudy/config or ./.rudy/config # machines and routines configuration goes in ./Rudyfile or # ./config/rudy/machines.rb and ./config/rudy/routines.rb # # --------------------------------------------------------- MACHINES -------- # The machines block describes the "physical" characteristics # of your environments. machines do users do # If you already have private keys for logging in to your EC2 instances # EC2 instances you can specify them here and Rudy will use these instead. # root :keypair => "/#{Rudy.sysinfo.home}/.rudy/root-private-key" end zone :"us-east-1b" do ami 'ami-235fba4a' # Amazon Getting Started AMI (US) end zone :"eu-west-1b" do ami 'ami-e40f2790' # Amazon Getting Started AMI (EU) end # We've defined an environment called "stage" with one role: "app". # The configuration inside the env block is available to all its # roles. The configuration inside the role blocks is available only # to machines in that specific role. env :stage do ami "ami-5394733a" # ec2onrails/ec2onrails-v0_9_9_1-i386.manifest.xml size 'm1.small' role :app do positions 1 #addresses '11.22.33.44', '55.66.77.88' # We define two disks for the stage-app machines disks do path "/rudy/disk1" do size 2 device "/dev/sdr" end path "/rudy/disk2" do size 1 device "/dev/sdm" end end end # Here are some examples of other roles. These can be anything. role :db do end role :analysis do end role :balancer do end end # The routines section below contains calls to local and remote # scripts. The config contained in this block is made available # those scripts in the form of a yaml file. The file is called # rudy-config.yml. config do dbmaster 'localhost' newparam 573114 end end # ----------------------------------------------------------- ROUTINES -------- # The routines block describes the repeatable processes for each machine group. routines do env :stage do role :app do startup do before_local Rudy.sysinfo.user => :uname disks do create "/rudy/disk1" end after :root => [:uname, :a] after :root => [:touch, '/rudy/disk1/rudy-was-here'] after_local Rudy.sysinfo.user => :date end shutdown do before :root => '/a/nonexistent/script' before :root => :uptime disks do destroy "/rudy/disk1" end end end end end