summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging/tasks/scale.yaml
blob: aa3e396410f19f92af12ec4c2acea72b0334cb7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- command: >
    {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}}
    -o jsonpath='{.spec.replicas}' -n {{openshift_logging_namespace}}
  register: replica_count
  failed_when: replica_count.rc == 1 and 'exists' not in replica_count.stderr
  when: not ansible_check_mode

- command: >
    {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig scale {{object}}
    --replicas={{desired}} -n {{openshift_logging_namespace}}
  register: scale_result
  failed_when: scale_result.rc == 1 and 'exists' not in scale_result.stderr
  when:
  - not ansible_check_mode
  - replica_count.stdout|int != desired

- command: >
    {{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}} -n {{openshift_logging_namespace}} -o jsonpath='{.status.replicas}'
  register: replica_counts
  until: replica_counts.stdout|int == desired
  retries: 30
  delay: 10
  when:
    - not ansible_check_mode
    - replica_count.stdout|int != desired