fixes to allow the provisioner container to run ansible on remote nodes
diff --git a/provisioner/Dockerfile b/provisioner/Dockerfile
index a193758..cf4a86b 100644
--- a/provisioner/Dockerfile
+++ b/provisioner/Dockerfile
@@ -32,6 +32,9 @@
apt-get update -y -m && \
apt-get install -y git ansible
+RUN mkdir -p /root/.ssh
+COPY ssh-config /root/.ssh/config
+
RUN go get github.com/tools/godep
ADD . $GOPATH/src/github.com/ciena/cord-provisioner
diff --git a/provisioner/handlers.go b/provisioner/handlers.go
index 11df6ee..42946da 100644
--- a/provisioner/handlers.go
+++ b/provisioner/handlers.go
@@ -101,5 +101,15 @@
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
+
+ switch s.Status {
+ case Pending, Running:
+ w.WriteHeader(http.StatusAccepted)
+ case Complete:
+ w.WriteHeader(http.StatusOK)
+ default:
+ w.WriteHeader(http.StatusInternalServerError)
+ }
+
w.Write(bytes)
}
diff --git a/provisioner/ssh-config b/provisioner/ssh-config
new file mode 100644
index 0000000..990a43d
--- /dev/null
+++ b/provisioner/ssh-config
@@ -0,0 +1,3 @@
+Host *
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null