Browse Source

upgrade: verify API server is accessible before masters upgrade

Vadim Rutkovsky 7 years ago
parent
commit
3b48dca22c
1 changed files with 14 additions and 0 deletions
  1. 14 0
      playbooks/openshift-master/private/upgrade.yml

+ 14 - 0
playbooks/openshift-master/private/upgrade.yml

@@ -13,6 +13,20 @@
       path: "{{ openshift.common.config_base }}/master/service-signer.crt"
     register: service_signer_cert_stat
     changed_when: false
+  - name: verify api server
+    command: >
+      curl --silent --tlsv1.2
+      --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
+      {{ openshift.master.api_url }}/healthz/ready
+    args:
+      # Disables the following warning:
+      # Consider using get_url or uri module rather than running curl
+      warn: no
+    register: api_available_output
+    until: api_available_output.stdout == 'ok'
+    retries: 120
+    delay: 1
+    changed_when: false
 
 - import_playbook: create_service_signer_cert.yml