CORD-616 make sure that platform can install via tunnel and some clean up

Change-Id: I3ce86a41e17135bad00305eb1e419544ae7fc912
diff --git a/roles/xos-vm-install/defaults/main.yml b/roles/xos-vm-install/defaults/main.yml
index 0be9d5b..14d04ab 100644
--- a/roles/xos-vm-install/defaults/main.yml
+++ b/roles/xos-vm-install/defaults/main.yml
@@ -17,4 +17,6 @@
 docker_opts: ""
 docker_tag: "latest"
 docker_registry: "docker.io"
+
 local_docker_registry: "docker-registry:5000"
+local_docker_tag: "{{ deploy_docker_tag | default('candidate') }}"
diff --git a/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml b/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml
index bf613be..ac4adc6 100644
--- a/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml
+++ b/roles/xos-vm-install/files/xos-setup-cord-pod-playbook.yml
@@ -79,7 +79,7 @@
       with_items: "{{ xos_images }}"
 
     - name: Check to see if registry is reachable
-      command: curl -sf http://docker-registry:5000/
+      command: curl -sf http://{{ local_docker_registry }}
       ignore_errors: yes
       register: docker_registry_check
       tags:
@@ -89,7 +89,7 @@
       set_fact:
          docker_registry: "{{ local_docker_registry }}"
          docker_opts: "--insecure-registry {{ local_docker_registry }}"
-         docker_tag: "candidate"
+         docker_tag: "{{ deploy_docker_tag }}"
       when: docker_registry_check|succeeded
 
     - name: Set docker options
diff --git a/roles/xos-vm-install/templates/xos-setup-vars.yml.j2 b/roles/xos-vm-install/templates/xos-setup-vars.yml.j2
index ed22592..95b21b4 100644
--- a/roles/xos-vm-install/templates/xos-setup-vars.yml.j2
+++ b/roles/xos-vm-install/templates/xos-setup-vars.yml.j2
@@ -24,3 +24,5 @@
 docker_registry: "{{ docker_registry }}"
 
 local_docker_registry: "{{ local_docker_registry }}"
+deploy_docker_registry: "{{ deploy_docker_registry }}"
+deploy_docker_tag: "{{ deploy_docker_tag }}"