You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. ---
  2. - hosts: kube-master[0]
  3. tasks:
  4. - name: Force binaries directory for Container Linux by CoreOS and Flatcar
  5. set_fact:
  6. bin_dir: "/opt/bin"
  7. when: ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"]
  8. - name: Force binaries directory for other hosts
  9. set_fact:
  10. bin_dir: "/usr/local/bin"
  11. when: not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"]
  12. - import_role:
  13. name: cluster-dump
  14. - name: Check kubectl output # noqa 301 305
  15. shell: "{{ bin_dir }}/kubectl get nodes"
  16. register: get_nodes
  17. no_log: true
  18. - debug:
  19. msg: "{{ get_nodes.stdout.split('\n') }}"
  20. - name: Check that all nodes are running and ready # noqa 301 305
  21. shell: "{{ bin_dir }}/kubectl get nodes --no-headers -o yaml"
  22. register: get_nodes_yaml
  23. until:
  24. # Check that all nodes are Status=Ready
  25. - '(get_nodes_yaml.stdout | from_yaml)["items"] | map(attribute = "status.conditions") | map("items2dict", key_name="type", value_name="status") | map(attribute="Ready") | list | min'
  26. retries: 30
  27. delay: 10