playbook to refresh the VTN config in ONOS

Change-Id: I9988f4764b524478892f72b92a2de83f45a63cc9
diff --git a/roles/vtn-refresh/defaults/main.yml b/roles/vtn-refresh/defaults/main.yml
new file mode 100644
index 0000000..9243db9
--- /dev/null
+++ b/roles/vtn-refresh/defaults/main.yml
@@ -0,0 +1,8 @@
+---
+# vtn-refresh/defaults/main.yml
+
+xos_admin_user: xosadmin@opencord.org
+xos_admin_pass: "{{ lookup('password', 'credentials/xosadmin@opencord.org chars=ascii_letters,digits') }}"
+
+keystone_admin_password: "{{ lookup('password', 'credentials/cord_keystone_admin chars=ascii_letters,digits') }}"
+
diff --git a/roles/vtn-refresh/tasks/main.yml b/roles/vtn-refresh/tasks/main.yml
new file mode 100644
index 0000000..7b5273f
--- /dev/null
+++ b/roles/vtn-refresh/tasks/main.yml
@@ -0,0 +1,20 @@
+---
+# vtn-refresh/defaults/main.yml
+
+- name: Refresh VTN state
+  shell: "sshpass -p 'karaf' ssh -p 8102 karaf@onos-cord {{ item }}"
+  ignore_errors: yes
+  with_items:
+    - "cordvtn-sync-neutron-states https://keystone.cord.lab:5000/v2.0 admin {{ keystone_admin_pass }}"
+    - "cordvtn-sync-xos-states http://xos:{{ xos_ui_port }} {{ xos_admin_user }} {{ xos_admin_pass }}"
+    - "cordvtn-purge-rules"
+  tags:
+    - skip_ansible_lint # running commands on ONOS
+
+- name: Reload compute nodes in VTN
+  shell: "sshpass -p 'karaf' ssh -p 8102 karaf@onos-cord cordvtn-node-init {{ hostvars[item]['ansible_hostname'] }}"
+  ignore_errors: yes
+  with_items: "{{ groups['compute'] }}"
+  tags:
+    - skip_ansible_lint # running commands on ONOS
+