Wolfgang Kulhanek
2019-10-11 99fd5ff4a6e5815616360f54e936f8c5e067d68f
ansible/configs/ocp4-workshop/lifecycle.yml
@@ -117,4 +117,20 @@
    - when: r_csrs.stdout_lines | length > 0
      name: Approve all Pending CSRs
      command: "oc adm certificate approve {{ item }}"
      loop: "{{ r_csrs.stdout_lines }}"
      loop: "{{ r_csrs.stdout_lines }}"
    # TODO: Implement proper loop to watch for incoming CSRS while we are
    # approving them. For now, this is a workaround, just wait and re-approve.
    - name: Wait 10s for additional CSRs to appear
      pause:
        seconds: 10
    - name: Get additional CSRs that need to be patched
      command: oc get csr -oname
      register: r_new_csrs
      changed_when: false
    - when: r_new_csrs.stdout_lines | length > 0
      name: Approve all Pending CSRs
      command: "oc adm certificate approve {{ item }}"
      loop: "{{ r_new_csrs.stdout_lines }}"