fix(ansible): Compatibility improvements
[csit.git] / fdio.infra.ansible / roles / csit_sut_image / tasks / main.yaml
index 9dddbe4..f0a93c0 100644 (file)
@@ -2,7 +2,7 @@
 # file: roles/csit_sut_image/tasks/main.yaml
 
 - name: Create a directory if it does not exist
-  file:
+  ansible.builtin.file:
     path: "/opt/csit-sut/"
     state: "directory"
     mode: 0755
@@ -10,7 +10,7 @@
     - csit-sut-image
 
 - name: Copy Build Items
-  copy:
+  ansible.builtin.copy:
     src: "{{ item }}"
     dest: "/opt/csit-sut/"
     owner: "root"
     - csit-sut-image
 
 - name: Build CSIT SUT Docker Image
-  shell: "docker build -t csit_sut-ubuntu2004:local ."
+  ansible.builtin.shell: "docker build -t csit_sut-ubuntu2204:local ."
   args:
     chdir: "/opt/csit-sut"
+  async: 3000
+  poll: 0
+  register: docker_built
   tags:
     - csit-sut-image
+
+- name: Check if CSIT SUT Docker Image is Built
+  async_status:
+    jid: "{{ docker_built.ansible_job_id }}"
+  register: docker_built
+  until: docker_built.finished
+  delay: 10
+  retries: 300
+  tags:
+    - csit-sut-image
\ No newline at end of file