[CORD-2577]
Allow head-prep to run on non-openstack scenarios

Change-Id: I52a93cfc91ba712170210eeeb6b3068756907167
diff --git a/roles/head-prep/defaults/main.yml b/roles/head-prep/defaults/main.yml
index 4f9c601..abdc20e 100644
--- a/roles/head-prep/defaults/main.yml
+++ b/roles/head-prep/defaults/main.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,11 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # head-prep/defaults/main.yml
 
-use_maas: false
+use_maas: False
+use_openstack: True
 
 ssh_pki_dir: "{{ playbook_dir }}/ssh_pki"
 ssh_keytype: rsa
diff --git a/roles/head-prep/tasks/main.yml b/roles/head-prep/tasks/main.yml
index afa7be3..3fcb40a 100644
--- a/roles/head-prep/tasks/main.yml
+++ b/roles/head-prep/tasks/main.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,8 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # file: head-prep/tasks/main.yml
 
 - name:  Install prerequisites for using PPA repos
@@ -45,19 +43,27 @@
     - bridge-utils
     - dnsutils
     - git
-    - juju-core
     - libssl-dev
-    - libvirt-bin
     - python-dev
     - python-dnspython
-    - python-glanceclient
-    - python-keystoneclient
     - python-lxml
     - python-netaddr
-    - python-neutronclient
-    - python-novaclient
     - python-pip
     - sshpass
+
+- name: Install juju and openstack related packages
+  when: use_openstack
+  apt:
+    name: "{{ item }}"
+    update_cache: yes
+    cache_valid_time: 3600
+  with_items:
+    - juju-core
+    - libvirt-bin
+    - python-glanceclient
+    - python-keystoneclient
+    - python-neutronclient
+    - python-novaclient
     - virt-top
 
 - name: Make sure Ansible is newest version