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.

23 lines
674 B

  1. ---
  2. - hosts: node1
  3. tasks:
  4. - name: Force binaries directory for CoreOS
  5. set_fact:
  6. bin_dir: "/opt/bin"
  7. when: ansible_os_family == "CoreOS"
  8. - set_fact:
  9. bin_dir: "/usr/local/bin"
  10. when: ansible_os_family != "CoreOS"
  11. - name: Run a replica controller composed of 2 pods
  12. shell: "{{bin_dir}}/kubectl run test --image=busybox --replicas=2 --command -- tail -f /dev/null"
  13. - name: Pods are running
  14. shell: "{{bin_dir}}/kubectl get pods --no-headers -o json"
  15. register: run_pods_log
  16. until: [ '(run_pods_log.stdout | from_json)["items"] | map(attribute = "status.phase") | join(",") == "Running,Running"' ]
  17. retries: 24
  18. delay: 5