[CORD-2349] Migrating REM-CORD
Change-Id: Iae573428e3bee89026262055263f24a32dd12183
diff --git a/roles/compute-node-enable/defaults/main.yml b/roles/compute-node-enable/defaults/main.yml
index 69af4b6..4123df8 100644
--- a/roles/compute-node-enable/defaults/main.yml
+++ b/roles/compute-node-enable/defaults/main.yml
@@ -17,7 +17,12 @@
---
# compute-node-enable/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"
+xos_admin_pass: "{{ lookup('password', head_credentials_dir ~ '/xosadmin@opencord.org chars=ascii_letters,digits') }}"
diff --git a/roles/compute-node-enable/tasks/main.yml b/roles/compute-node-enable/tasks/main.yml
index 453b15a..2644671 100644
--- a/roles/compute-node-enable/tasks/main.yml
+++ b/roles/compute-node-enable/tasks/main.yml
@@ -18,7 +18,14 @@
# compute-node-enable/tasks/main.yml
- name: Load TOSCA to add OpenStack compute nodes
- command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ head_cord_profile_dir }}/{{ item }}"
+ uri:
+ url: "{{ xos_tosca_url }}/run"
+ method: POST
+ headers:
+ xos-username: "{{ xos_admin_user }}"
+ xos-password: "{{ xos_admin_pass }}"
+ body: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}"
+ status_code: 200
with_items:
- openstack.yaml
- openstack-compute.yaml
@@ -30,7 +37,14 @@
seconds: 20
- name: Load TOSCA to enable VTN on OpenStack compute nodes
- command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ head_cord_profile_dir }}/{{ item }}"
+ uri:
+ url: "{{ xos_tosca_url }}/run"
+ method: POST
+ headers:
+ xos-username: "{{ xos_admin_user }}"
+ xos-password: "{{ xos_admin_pass }}"
+ body: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}"
+ status_code: 200
with_items:
- vtn-service.yaml
- openstack-compute-vtn.yaml