Created
June 20, 2011 11:26
-
-
Save chapmanb/1035463 to your computer and use it in GitHub Desktop.
Running pallet with manual specification of a server; example with vagrant virtualbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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