Browse Source

Merge pull request #8586 from vrutkovs/node-upgrade-approve-csr

Approve node CSRs during node upgrade
OpenShift Merge Robot 6 years ago
parent
commit
a64b32117b
1 changed files with 21 additions and 4 deletions
  1. 21 4
      roles/openshift_node/tasks/upgrade/restart.yml

+ 21 - 4
roles/openshift_node/tasks/upgrade/restart.yml

@@ -30,12 +30,29 @@
   retries: 3
   delay: 30
 
-- name: Start services
-  service: name={{ item }} state=started
-  with_items:
-    - "{{ openshift_service_type }}-node"
+- name: Start node service
+  service:
+    name: "{{ openshift_service_type }}-node"
+    state: started
+  async: 1
+  poll: 0
+  register: node_service
   failed_when: false
 
+- name: Approve the node
+  oc_adm_csr:
+    nodes: ["{{ openshift.node.nodename }}"]
+    timeout: 60
+    fail_on_timeout: true
+  delegate_to: "{{ groups.oo_first_master.0 }}"
+
+- name: Check status of node service
+  async_status:
+    jid: "{{ node_service.ansible_job_id }}"
+  register: job_result
+  until: job_result.finished
+  retries: 30
+
 - name: Wait for master API to come back online
   wait_for:
     host: "{{ openshift.common.hostname }}"