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
+
diff --git a/vtn-refresh-playbook.yml b/vtn-refresh-playbook.yml
new file mode 100644
index 0000000..ba2fc6a
--- /dev/null
+++ b/vtn-refresh-playbook.yml
@@ -0,0 +1,17 @@
+---
+# vtn-refresh-playbook.yml
+# Refreshes the VTN state, via the ONOS commandline
+
+- name: Include vars
+  hosts: all
+  tasks:
+    - name: Include variables
+      include_vars: "{{ item }}"
+      with_items:
+        - "profile_manifests/{{ cord_profile }}.yml"
+        - profile_manifests/local_vars.yml
+
+- name: Refresh VTN config
+  hosts: head
+  roles:
+    - vtn-refresh