playbook to reinstall and restart xos

Change-Id: I0b89df850bea7bbc5452f5acb59bff6f89422a9d
diff --git a/roles/xos-uninstall/defaults/main.yml b/roles/xos-uninstall/defaults/main.yml
new file mode 100644
index 0000000..74d34c1
--- /dev/null
+++ b/roles/xos-uninstall/defaults/main.yml
@@ -0,0 +1,8 @@
+---
+# default variables for xos-uninstall role
+
+xos_repo_dest: "{{ ansible_user_dir }}/xos"
+service_profile_repo_dest: "{{ ansible_user_dir }}/service-profile"
+
+xos_libraries_dest: "{{ ansible_user_dir }}/xos_libraries"
+xos_services_dest: "{{ ansible_user_dir }}/xos_services"
diff --git a/roles/xos-uninstall/tasks/main.yml b/roles/xos-uninstall/tasks/main.yml
new file mode 100644
index 0000000..c29c2fc
--- /dev/null
+++ b/roles/xos-uninstall/tasks/main.yml
@@ -0,0 +1,25 @@
+---
+# xos-head-start/tasks/main.yml
+
+- name: Check to see if service-profile exists
+  stat: path="{{ service_profile_repo_dest }}"
+  register: service_profile_dir
+
+- name: Run make cleanup
+  make:
+    chdir: "{{ service_profile_repo_dest }}/{{ xos_configuration }}"
+    target: "cleanup"
+  when: service_profile_dir.stat.exists == True
+
+- name: Remove service-profile directory
+  file: path="{{ service_profile_repo_dest }}" state=absent
+
+- name: Remove xos directory
+  file: path="{{ xos_repo_dest }}" state=absent
+
+- name: Remove xos services
+  file: path="{{ xos_services_dest }}" state=absent
+
+- name: Remove xos libraries
+  file: path="{{ xos_libraries_dest }}" state=absent
+