github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/ansible/_calico-validate.yaml (about)

     1  ---
     2    - hosts: master:worker:ingress:storage
     3      any_errors_fatal: true
     4      name: "{{ play_name | default('Validate Calico Network Components') }}"
     5      serial: "{{ serial_count | default('100%') }}"
     6      become: yes
     7      vars_files:
     8        - group_vars/all.yaml
     9  
    10      tasks:
    11        - name: get the name of the calico-node pod running on this node
    12          command: kubectl --kubeconfig {{ kubernetes_kubeconfig.kubectl }} get pods -l=k8s-app=calico-node --template {%raw%}'{{range .items}}{{if eq .spec.nodeName{%endraw%} "{{ inventory_hostname|lower }}"{%raw%}}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}'{%endraw%} -n kube-system
    13          register: pod_name
    14          until: pod_name is defined and pod_name.stdout is defined and pod_name.stdout != ""
    15          retries: 20
    16          delay: 6
    17  
    18        - name: wait until pod is in "Running" state
    19          command: kubectl --kubeconfig {{ kubernetes_kubeconfig.kubectl }} get pods {{ pod_name.stdout }} -o=jsonpath='{.status.phase}' -n kube-system
    20          register: readyPods
    21          until: readyPods.stdout == "Running"
    22          retries: 20
    23          delay: 6