Skip to content

Instantly share code, notes, and snippets.

@chapmanb
Created June 20, 2011 11:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chapmanb/1035463 to your computer and use it in GitHub Desktop.
Save chapmanb/1035463 to your computer and use it in GitHub Desktop.
Running pallet with manual specification of a server; example with vagrant virtualbox
(ns distblast-cluster.vagrant
(:require [pallet.compute :as compute]
[pallet.phase :as phase]
[pallet.core :as core]
[pallet.utils :as utils]
[pallet.compute.node-list :as node-list]
[pallet.action.exec-script :as exec-script]))
(defn test-script [session]
(-> session
(exec-script/exec-script
(ls -l))))
(def conn-map
{:provider "node-list"
:node-list [(node-list/make-node "vagrant" "tester" "127.0.0.1" :ubuntu
:ssh-port 2222)]
:environment {:user (utils/make-user "vagrant"
:private-key-path "/var/lib/gems/1.8/gems/vagrant-0.7.2/keys/vagrant")}})
(defn run-test []
(let [service (compute/compute-service-from-map conn-map)
server (core/server-spec
:node-spec (core/node-spec :image {:os-family :ubuntu})
:phases {:configure (phase/phase-fn
(test-script))})
group (core/group-spec "tester"
:extends server)]
(core/lift group
:phase :configure
:compute service)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment