[CORD-2289] add ng4T synchronizer and playbooks

Change-Id: Icf2c8095233a8748c9398f1840a580eaeff6bdb8
diff --git a/xos/synchronizer/steps/roles/ng4t_config/defaults/main.yml b/xos/synchronizer/steps/roles/ng4t_config/defaults/main.yml
index 2b9f42e..d9b0fa9 100644
--- a/xos/synchronizer/steps/roles/ng4t_config/defaults/main.yml
+++ b/xos/synchronizer/steps/roles/ng4t_config/defaults/main.yml
@@ -13,5 +13,6 @@
 # limitations under the License.
 
 ---
-ng4t_license_src:  /opt/xos/synchronizers/venb/files/ng4t-license.txt
-ng4t_license_dest: /tmp/license.txt
\ No newline at end of file
+ng4t_license_src:  /opt/xos/synchronizers/venb/files/ng40-license
+ng4t_license_dest: /home/ng40/install/ng40-license
+ng4t_ipconfig_dest: /home/ng40/install/ipconfig
\ No newline at end of file
diff --git a/xos/synchronizer/steps/roles/ng4t_config/tasks/main.yml b/xos/synchronizer/steps/roles/ng4t_config/tasks/main.yml
index 42e1049..e37d0f6 100644
--- a/xos/synchronizer/steps/roles/ng4t_config/tasks/main.yml
+++ b/xos/synchronizer/steps/roles/ng4t_config/tasks/main.yml
@@ -13,9 +13,43 @@
 # limitations under the License.
 
 ---
+- name: Set SSH password
+  set_fact:
+    ansible_ssh_pass: "{{ password }}"
+
+- name: check s11_network interface
+  shell: ifconfig | grep -B1 "inet addr:{{ mme_s11_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
+  args:
+    executable: /bin/bash
+  register: mme_s11_interface
+
+- name: check s1u_network interface
+  shell: ifconfig | grep -B1 "inet addr:{{ enb1_s1u_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
+  args:
+    executable: /bin/bash
+  register: enb1_s1u_interface
+
+- name: check sgi_network interface
+  shell: ifconfig | grep -B1 "inet addr:{{ appserver_sgi_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
+  args:
+    executable: /bin/bash
+  register: appserver_sgi_interface
+
 - name: Copy license file
   copy:
     src: "{{ ng4t_license_src }}"
     dest: "{{ ng4t_license_dest }}"
-    owner: root
-    mode: 0644
+
+- name: Create ipconfig file
+  template:
+    src: ./templates/ipconfig.j2
+    dest: "{{ ng4t_ipconfig_dest }}"
+
+- name: Set instance to hosts file
+  shell: "echo 127.0.1.1       $(cat /etc/hostname) >> /etc/hosts"
+
+- name: Start install ng4t
+  sudo: no
+  shell: /home/ng40/install/ng40init
+  args:
+    executable: /bin/bash
diff --git a/xos/synchronizer/steps/roles/ng4t_config/templates/ipconfig.j2 b/xos/synchronizer/steps/roles/ng4t_config/templates/ipconfig.j2
new file mode 100644
index 0000000..ef2bb1b
--- /dev/null
+++ b/xos/synchronizer/steps/roles/ng4t_config/templates/ipconfig.j2
@@ -0,0 +1,27 @@
+# ENB network
+ENB1_S1U_DEV={{ enb1_s1u_interface.stdout }}
+ENB1_S1U_IP={{ enb1_s1u_ip }}
+ENB1_S1U_NET={{ enb1_s1u_netmask }}
+#ENB2_S1U_DEV=ens6:1
+#ENB2_S1U_IP=111.0.0.4
+#ENB2_S1U_NET=24
+
+# MME network
+MME_S11_DEV={{ mme_s11_interface.stdout }}
+MME_S11_IP={{ mme_s11_ip }}
+MME_S11_NET={{ mme_s11_netmask }}
+
+# SAEGW network
+SGW_S11_IP={{ spgw_s11_ip }}
+
+# Application Server network
+AS_DEV={{ appserver_sgi_interface.stdout }}
+AS_IP={{ appserver_sgi_ip }}
+AS_GW={{ appserver_sgi_gateway }}
+AS_NET={{ appserver_sgi_netmask }}
+
+# Control (ssh) network
+SSH_NG40_RAN={{ ssh_venb_ip }}
+SSH_NGIC_CP_IP={{ ssh_vspgwc_ip }}
+SSH_NGIC_DP_IP={{ ssh_vspgwu_ip }}
+SSH_NGIC_FPC_IP={{ fpc_management_ip }}
\ No newline at end of file