     [taoensso.timbre :only (debug info error warn)]
     [clojure.string :only (join)]
     [slingshot.slingshot :only  [throw+ try+]]))
+
 
 
 (def ssh-opts {:username "root" :strict-host-key-checking :no})

(defn copy [server module]
  (put (:host server) (str (module :src) (module :name) ".tar.gz")  "/tmp"))

(defn execute [{:keys [host]} & batches]
  (with-session host
    (fn [session]
      (doseq [b batches]
        (let [{:keys [exit out] :as res} (ssh session {:in  (join "\n" b) })]
          (if (= exit 0)
            (debug out) 
            (throw+ (merge res {:type ::provision-failed} (meta b)))))))))

(defn step [n & steps] ^{:step n} steps)


    (use 'celestial.core)
    (copy server module) 
    (execute server 
      (step :extract "cd /tmp" (<< "tar -xzf ~(:name module).tar.gz")) 
      (step :run (<< "cd /tmp/~(:name module)") "./run.sh")
      (step :cleanup "cd /tmp" (<< "rm -rf ~(:name module)*"))) ))


#_(.apply-
