scale.yaml 1.0 KB

1234567891011121314151617181920212223242526
  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. - command: >
  9. {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig scale {{object}}
  10. --replicas={{desired}} -n {{openshift_logging_namespace}}
  11. register: scale_result
  12. failed_when: scale_result.rc == 1 and 'exists' not in scale_result.stderr
  13. when:
  14. - not ansible_check_mode
  15. - replica_count.stdout|int != desired
  16. - command: >
  17. {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}} -n {{openshift_logging_namespace}} -o jsonpath='{.status.replicas}'
  18. register: replica_counts
  19. until: replica_counts.stdout|int == desired
  20. retries: 30
  21. delay: 10
  22. when:
  23. - not ansible_check_mode
  24. - replica_count.stdout|int != desired