Skip to content

Instantly share code, notes, and snippets.

@xlson
Created October 21, 2011 12:50
Show Gist options
  • Save xlson/1303759 to your computer and use it in GitHub Desktop.
Save xlson/1303759 to your computer and use it in GitHub Desktop.
basic-pallet-ec2
(ns quickstart.core
(:require pallet.core
pallet.compute
pallet.phase
pallet.crate.automated-admin-user))
(def basicnode
(pallet.core/node-spec
:image {:os-family :ubuntu :os-version-matches "10.10"}
:hardware {:min-cores 2 :min-ram 512}
:network {:inbound-ports [22 80]}))
(def with-admin-user
(pallet.core/server-spec
:phases {:bootstrap (pallet.phase/phase-fn
(pallet.crate.automated-admin-user/automated-admin-user))}))
(def basicgroup
(pallet.core/group-spec "basicgroup"
:node-spec basicnode
:extends [with-admin-user]))
(defn scale-cluster [n]
(pallet.core/converge
(pallet.core/group-spec "basicgroup" :count n)
:compute (pallet.compute/service "aws")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment