CORD-1000 Build and publish XOS images on corddev

Change-Id: I6491b43e518abb8a56aec98b5a71e8d293fc7ef9
diff --git a/roles/build-images/tasks/main.yml b/roles/build-images/tasks/main.yml
new file mode 100644
index 0000000..6563ab2
--- /dev/null
+++ b/roles/build-images/tasks/main.yml
@@ -0,0 +1,43 @@
+---
+# build-images/tasks/main.yml
+
+- name: Clean up chameleon temp directory
+  file:
+    path: "{{ cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon"
+    state: absent
+  with_items: "{{ chameleon_dirs }}"
+
+- name: Populate chameleon temp directory
+  shell: cp -a "{{ cord_dir }}/component/chameleon" "{{ item }}"
+  with_items: "{{ chameleon_dirs }}"
+  tags:
+    - skip_ansible_lint # docker can't access files outside of build context, so we must copy
+
+# If an image was previously pulled it won't get built
+- name: Build images
+  docker_image:
+    name: "{{ item.name }}"
+    path: "{{ item.path }}"
+    tag: "{{ build_docker_tag }}"
+    dockerfile: "{{ item.dockerfile }}"
+    pull: False
+  with_items: "{{ docker_images }}"
+
+- name: Build optional images
+  docker_image:
+    name: "{{ item.name }}"
+    path: "{{ item.path }}"
+    tag: "{{ build_docker_tag }}"
+    dockerfile: "{{ item.dockerfile }}"
+    pull: False
+  with_items: "{{ docker_optional_images }}"
+  when: build_optional_images
+
+# Build extensions images
+- name: Build xos-gui-extensions docker images
+  docker_image:
+    name: "xosproject/gui-extension-{{ item.name }}"
+    path: "{{ cord_dir }}/{{ item.path }}"
+    tag: "{{ build_docker_tag }}"
+    pull: False
+  with_items: "{{ enabled_gui_extensions }}"