pallet/pallet-repl — pull request #6 by tbatchelli (2014-05-29 19:37:08+00:00)
Title: Initial implementation of step-wise execution for #5

phases)

```clojure
(use 'pallet.repl)
(use 'pallet.api)
(use 'pallet.actions)
(require '[pallet.crate :as crate])

(def c (compute-service :aws))

;; initiate session
(start-repl-session c {:image {:image-id "us-east-1/ami-89181be0"}})

;; do a mock run of a plan function
(explain-step (plan-fn (exec-script "ls -la /")(crate/assoc-settings :mongodb [:cluster false])))

NODE: [repl-session-36fc6e65 repl-session 54.82.169.150 :ubuntu :os-version nil :id us-east-1/i-36fc6e65]
ACTION: pallet.actions/exec-script* of type script executed on target
FORM:
(pallet.actions/exec-script* "ls -la /")
SCRIPT:
| ls -la /
nil

(step-lift (plan-fn (exec-script "ls -la /")(crate/assoc-settings :mongodb [:cluster false])))
12:35:49.540 [operate-96] INFO pallet.ssh.execute - 54.82.169.150 22
SESSION:
NODE: repl-session-36fc6e65 IP: 54.82.169.150 GROUP: :repl-session
nil

PHASES: configure
GROUPS: repl-session
ACTIONS:
PHASE configure:
GROUP repl-session:
NODE 54.82.169.150:
ACTION ON NODE:
SCRIPT:
| #!/usr/bin/env bash
| set -h
| ls -la /
| exit $?
EXIT CODE: 0
OUTPUT:
| total 84
| drwxr-xr-x 22 root root 4096 May 29 18:08 .
| drwxr-xr-x 22 root root 4096 May 29 18:08 ..
| drwxr-xr-x 2 root root 4096 Feb 26 03:35 bin
| drwxr-xr-x 3 root root 4096 Feb 26 03:35 boot
| drwxr-xr-x 13 root root 3920 May 29 18:08 dev
| drwxr-xr-x 89 root root 4096 May 29 18:09 etc
| drwxr-xr-x 4 root root 4096 May 29 18:09 home
| lrwxrwxrwx 1 root root 34 Feb 26 03:35 initrd.img -> /boot/initrd.img-3.11.0-17-generic
| drwxr-xr-x 20 root root 4096 Feb 26 03:34 lib
| drwxr-xr-x 2 root root 4096 Feb 26 03:33 lib64
| drwx------ 2 root root 16384 Feb 26 03:35 lost+found
| drwxr-xr-x 2 root root 4096 Feb 26 03:33 media
| drwxr-xr-x 3 root root 4096 Jan 13 07:37 mnt
| drwxr-xr-x 2 root root 4096 Feb 26 03:33 opt
| dr-xr-xr-x 85 root root 0 May 29 18:08 proc
| drwx------ 3 root root 4096 May 29 18:08 root
| drwxr-xr-x 17 root root 640 May 29 19:35 run
| drwxr-xr-x 2 root root 4096 Feb 26 03:35 sbin
| drwxr-xr-x 2 root root 4096 Feb 26 03:33 srv
| dr-xr-xr-x 13 root root 0 May 29 18:08 sys
| drwxrwxrwt 4 root root 4096 May 29 19:35 tmp
| drwxr-xr-x 10 root root 4096 Feb 26 03:33 usr
| drwxr-xr-x 13 root root 4096 Feb 26 03:35 var
| lrwxrwxrwx 1 root root 30 Feb 26 03:35 vmlinuz -> boot/vmlinuz-3.11.0-17-generic
SESSION:
NODE: repl-session-36fc6e65 IP: 54.82.169.150 GROUP: :repl-session
{:mongodb {nil {:cluster false}}}
```