Infra: Ansible sync
[csit.git] / resources / tools / testbed-setup / ansible / roles / csit_shim_image / tasks / main.yaml
diff --git a/resources/tools/testbed-setup/ansible/roles/csit_shim_image/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/csit_shim_image/tasks/main.yaml
new file mode 100644 (file)
index 0000000..bdba4f6
--- /dev/null
@@ -0,0 +1,32 @@
+---
+# file: roles/csit_shim_image/tasks/main.yaml
+
+- name: Create a directory if it does not exist
+  file:
+    path: "{{ item }}"
+    state: "directory"
+    mode: 0755
+  with_items:
+    - "/opt/csit-shim/"
+    - "/opt/csit-shim/files"
+  tags: csit-shim-image
+
+- name: Copy Build Items
+  copy:
+    src: "{{ item }}"
+    dest: "/opt/csit-shim/{{ item }}"
+    owner: "root"
+    group: "root"
+    mode: 0655
+  with_items:
+    - "Dockerfile"
+    - "files/badkeypub"
+    - "files/sshconfig"
+    - "files/wrapdocker"
+  tags: csit-shim-image
+
+- name: Build CSIT shim Docker Image
+  shell: "docker build -t csit_shim-ubuntu1804:local ."
+  args:
+    chdir: "/opt/csit-shim"
+  tags: csit-shim-image
\ No newline at end of file