Skip to content

Instantly share code, notes, and snippets.

@murtaza52
Created August 30, 2012 13:24
Show Gist options
  • Save murtaza52/3528456 to your computer and use it in GitHub Desktop.
Save murtaza52/3528456 to your computer and use it in GitHub Desktop.
Pallet complete example
(ns actions.clj
(:require [pallet.core]
[pallet.compute]
[pallet.action.package]))
(def hardware-types {:micro "t1.micro" :small "m1.small" :cpu-medium "c1.medium" :medium "m1.medium" :large "m1.large"})
(def ubuntu-app-server
(pallet.core/node-spec
:image {:os-family :ubuntu}
:hardware {:hardware-id (:small hardware-types)}
:network {:location-id "us-east-1a"}))
(def with-ant
(pallet.core/server-spec
:phases {:configure (pallet.phase/phase-fn
(pallet.action.package/package "ant"))}))
(def mygroup
(pallet.core/group-spec
"mygroup" :extends [with-ant] :node-spec ubuntu-app-server))
(pallet.core/lift
(pallet.core/group-spec "app-servers")
:compute (pallet.configure/compute-service :data-center)
:phase {:configure (pallet.phase/phase-fn
(pallet.action.package/package "ant"))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment