فهرست منبع

Merge pull request #4094 from ashcrow/status-doesnt-exist

Ensure good return code for specific until loops
Jan Chaloupka 7 سال پیش
والد
کامیت
129dd9ccfb
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      playbooks/common/openshift-node/restart.yml
  2. 1 1
      roles/openshift_node_upgrade/tasks/main.yml

+ 1 - 1
playbooks/common/openshift-node/restart.yml

@@ -51,7 +51,7 @@
     register: node_output
     delegate_to: "{{ groups.oo_first_master.0 }}"
     when: inventory_hostname in groups.oo_nodes_to_config
-    until: node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
+    until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
     # Give the node two minutes to come back online.
     retries: 24
     delay: 5

+ 1 - 1
roles/openshift_node_upgrade/tasks/main.yml

@@ -143,7 +143,7 @@
     name: "{{ openshift.common.hostname | lower }}"
   register: node_output
   delegate_to: "{{ groups.oo_first_master.0 }}"
-  until: node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
+  until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
   # Give the node two minutes to come back online.
   retries: 24
   delay: 5