CORD-2954 Playbook automating documented openstack-helm installation instructions

Change-Id: Ibf2072c01925c82302a91ea13c8ebaf4e21db80c
diff --git a/openstack-helm/roles/deploy-xos/tasks/main.yml b/openstack-helm/roles/deploy-xos/tasks/main.yml
new file mode 100644
index 0000000..376e8ea
--- /dev/null
+++ b/openstack-helm/roles/deploy-xos/tasks/main.yml
@@ -0,0 +1,50 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+- name: Chart dependencies
+  command: helm dep update ./xos-profiles/base-openstack
+  args:
+    chdir: "{{ ansible_env.HOME }}/cord/build/helm-charts"
+  tags:
+  - skip_ansible_lint
+
+- name: Install charts
+  command: helm upgrade --install {{ item.name }} {{ item.path }}
+  args:
+    chdir: "{{ ansible_env.HOME }}/cord/build/helm-charts"
+  with_items:
+  - { name: xos-core, path: ./xos-core }
+  - { name: base-openstack, path: ./xos-profiles/base-openstack }
+  - { name: onos-cord, path: "./onos -f configs/onos-cord.yaml" }
+  tags:
+  - skip_ansible_lint
+
+- name: Wait for ONOS to come up
+  shell: kubectl get pod | grep onos-cord | grep Running
+  register: result
+  until: result is success
+  retries: 30
+  delay: 10
+  tags:
+  - skip_ansible_lint
+
+- name: Add head node private key to ONOS (HACK - should be a secret or something)
+  shell: |
+    HEAD_PRIVKEY={{ ansible_env.HOME}}/cord/build/scenarios/preppedkube/.vagrant/machines/head1/libvirt/private_key
+    ONOS_CORD_POD=$( kubectl get pod | grep onos-cord | awk '{print $1}' )
+    kubectl cp $HEAD_PRIVKEY $ONOS_CORD_POD:/root/node_key
+  tags:
+  - skip_ansible_lint