瀏覽代碼

Add async_status check to manifest apply

Russell Teague 6 年之前
父節點
當前提交
5a9fdee79e
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      roles/openshift_node40/tasks/config.yml

+ 9 - 1
roles/openshift_node40/tasks/config.yml

@@ -63,12 +63,20 @@
       podman_mounts: "-v /:/rootfs -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd"
       mcd_command: "start --node-name {{ ansible_hostname }} --once-from {{ ign_file }}"
     # MCD reboots the machine, run the task but do not wait for completion
-    async: 60
+    register: manifest_apply
+    async: 900  # 15 minutes
     poll: 0
 
   # Wait for the host to come back
   - wait_for_connection: {}
 
+  # If the job fails, the async job status will find rc != 1 and will fail here
+  # When the job is successful, Ansible does not update this job status due to
+  # the host rebooting
+  - name: Check manifest apply status
+    async_status:
+      jid: "{{ manifest_apply.ansible_job_id }}"
+
   rescue:
   - fail:
       msg: "Ignition apply failed"