[CORD-2453] Remove the old TOSCA engine (and obsolete roles/playbooks)

Change-Id: I769303b5ddfa6e2a6ffd5bcc08e6e7f3285e7bba
diff --git a/roles/xos-config/defaults/main.yml b/roles/xos-config/defaults/main.yml
index 087ad78..afe9481 100644
--- a/roles/xos-config/defaults/main.yml
+++ b/roles/xos-config/defaults/main.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,12 +13,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # xos-config/defaults/main.yml
 
+xos_tosca_url: "http://xos-tosca/xos-tosca"
+
+head_credentials_dir: "/opt/credentials"
+
+head_cord_profile_dir: "/opt/cord_profile"
+
 xos_admin_user: "xosadmin@opencord.org"
+head_xos_admin_pass: "{{ lookup('file', head_credentials_dir ~ '/' ~ xos_admin_user) }}"
 
 xos_tosca_config_templates: []
 
+xos_new_tosca_config_templates: []
+
 use_openstack: True
diff --git a/roles/xos-config/tasks/main.yml b/roles/xos-config/tasks/main.yml
index d05e034..cc56304 100644
--- a/roles/xos-config/tasks/main.yml
+++ b/roles/xos-config/tasks/main.yml
@@ -1,4 +1,4 @@
-
+---
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,30 +13,52 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
----
 # xos-config/tasks/main.yml
 
-# TODO move this to the TOSCA container
+- name: Bootstrap XOS database - create site, deployment, admin user
+  uri:
+    url: "{{ xos_tosca_url }}/run"
+    method: POST
+    headers:
+      xos-username: "{{ xos_admin_user }}"
+      xos-password: "{{ head_xos_admin_pass }}"
+    body: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}"
+    status_code: 200
+  register: result
+  until: result | success
+  retries: 40
+  delay: 2
+  with_items:
+    - "fixtures.yaml"
+    - "deployment.yaml"
 
-# - name: Bootstrap XOS database - create site, deployment, admin user
-#   command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/{{ item }}"
-#   with_items:
-#     - "fixtures.yaml"
-#     - "deployment.yaml"
-#   tags:
-#     - skip_ansible_lint # TOSCA loading should be idempotent
+- name: Configure XOS with OpenStack config
+  uri:
+    url: "{{ xos_tosca_url }}/run"
+    method: POST
+    headers:
+      xos-username: "{{ xos_admin_user }}"
+      xos-password: "{{ head_xos_admin_pass }}"
+    body: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}"
+    status_code: 200
+  register: result
+  until: result | success
+  retries: 40
+  delay: 2
+  with_items:
+    - openstack.yaml
 
-# - name: Configure XOS with OpenStack config
-#   command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/{{ item }}"
-#   with_items:
-#     - openstack.yaml
-#   tags:
-#     - skip_ansible_lint # TOSCA loading should be idempotent
-
-- name: Configure XOS with profile specific TOSCA
-  command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/{{ item }}"
-  with_items: "{{ xos_tosca_config_templates }}"
-  tags:
-    - skip_ansible_lint # TOSCA loading should be idempotent
-
+- name: Configure XOS with profile specific TOSCA (new Engine)
+  uri:
+    url: "{{ xos_tosca_url }}/run"
+    method: POST
+    headers:
+      xos-username: "{{ xos_admin_user }}"
+      xos-password: "{{ head_xos_admin_pass }}"
+    body: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}"
+    status_code: 200
+  register: result
+  until: result | success
+  retries: 40
+  delay: 2
+  with_items: "{{ xos_new_tosca_config_templates }}"