Skip to content

Instantly share code, notes, and snippets.

@bmaddy
Created February 4, 2012 21:20
Show Gist options
  • Save bmaddy/1740204 to your computer and use it in GitHub Desktop.
Save bmaddy/1740204 to your computer and use it in GitHub Desktop.
(ns prov.core
(:require [pallet.core]
[pallet.utils :as utils]
[pallet.phase :as phase]
[pallet.action.package :as package]
[pallet.compute :as compute]
[pallet.crate.ssh :as ssh]
[pallet.crate.automated-admin-user :as automated-admin-user]))
(def service
(compute/service :aws))
(def riak-node
(pallet.core/node-spec
;:image {:os-family :ubuntu :os-version-matches "10.10"}
; Amazon Linux AMI
:image {:image-id "us-east-1/ami-31814f58"}
:network {:inbound-ports [22]}
:qos {:enable-monitoring true}))
(def base-server
(pallet.core/server-spec
:phases {:bootstrap (phase/phase-fn (automated-admin-user/automated-admin-user))
:configure (phase/phase-fn
(ssh/openssh)
(ssh/iptables-accept)
(package/package "curl"))}))
(def riak
(pallet.core/group-spec
"basic-group" :extends [base-server] :node-spec riak-node))
(defn list-nodes []
(compute/nodes service))
(defn scale-cluster [n]
(pallet.core/converge
{riak n}
:compute service))
;(scale-cluster 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment