Wolfgang Kulhanek
2019-09-01 0e7ce0ab7e026ed1062ade9b2ea35e1a60a16ae5
Updated after 2 tests
1 files modified
25 ■■■■ changed files
ansible/configs/ocp4-workshop/lifecycle.yml 25 ●●●● patch | view | raw | blame | history
ansible/configs/ocp4-workshop/lifecycle.yml
@@ -45,22 +45,21 @@
          "tag:env_type": "{{ env_type }}"
- name: Run recover cluster actions
  hosts: bastions
  run_once: True
  gather_facts: False
  hosts: localhost
  run_once: yes
  become: no
  tasks:
  - name: Recover cluster if it missed cert rotation
    delegate_to: "bastion.{{ guid }}{{ subdomain_base_suffix }}"
    when: ACTION == 'start'
    # environment:
    #   KUBECONFIG: "cluster-{{ guid }}/auth/kubeconfig"
    block:
    - name: Wait 5 minutes for Nodes to settle and pods to start
    - name: Wait 150 seconds for Nodes to settle and pods to start
      pause:
        minutes: 5
    - name: Get Node Readiness status
      shell: "oc get nodes|grep -v AGE|awk -c '{print $2}'"
      register: r_nodestatus
    - name: Approve CSRs if Nodes show NotReady
      when: "'NotReady' in r_nodestatus.stdout_lines"
      shell: "oc get csr -oname | xargs oc adm certificate approve"
        seconds: 150
    # - name: Get Node Readiness status
    #   shell: "oc get nodes|grep -v AGE|awk -c '{print $2}'"
    #   register: r_nodestatus
    - name: Approve all Pending CSRs
#      when: "'NotReady' in r_nodestatus.stdout_lines"
      shell: "oc get csr -oname | xargs oc adm certificate approve"
      ignore_errors: yes