scale.yaml 1.1 KB

12345678910111213141516171819202122232425262728
  1. ---
  2. - command: >
  3. {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}}
  4. -o jsonpath='{.spec.replicas}' -n {{openshift_logging_namespace}}
  5. register: replica_count
  6. failed_when: replica_count.rc == 1 and 'exists' not in replica_count.stderr
  7. when: not ansible_check_mode
  8. changed_when: no
  9. - command: >
  10. {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig scale {{object}}
  11. --replicas={{desired}} -n {{openshift_logging_namespace}}
  12. register: scale_result
  13. failed_when: scale_result.rc == 1 and 'exists' not in scale_result.stderr
  14. when:
  15. - not ansible_check_mode
  16. - replica_count.stdout|int != desired
  17. - command: >
  18. {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}} -n {{openshift_logging_namespace}} -o jsonpath='{.status.replicas}'
  19. register: replica_counts
  20. until: replica_counts.stdout|int == desired
  21. retries: 30
  22. delay: 10
  23. when:
  24. - not ansible_check_mode
  25. - replica_count.stdout|int != desired
  26. changed_when: no