blob: 031336a0126d192b948cf96cfbb63220ab26d042 (
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
27
|
---
- shell: >
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig get {{object}}
--template='{{ '{{.spec.replicas}}' }}' -n {{openshift_metrics_project}}
register: replica_count
failed_when: "replica_count.rc == 1 and 'exists' not in replica_count.stderr"
when: not ansible_check_mode
- shell: >
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig scale {{object}}
--replicas={{desired}} -n {{openshift_metrics_project}}
register: scale_result
failed_when: scale_result.rc == 1 and 'exists' not in scale_result.stderr
when:
- replica_count.stdout != desired
- not ansible_check_mode
- name: Waiting for {{object}} to scale to {{desired}}
shell: >
{{ openshift.common.client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig describe {{object}} -n {{openshift_metrics_project}} | awk -v statusrx='Pods Status:' '$0 ~ statusrx {print $3}'
register: replica_counts
until: replica_counts.stdout.find("{{desired}}") != -1
retries: 30
delay: 10
when:
- replica_count.stdout != desired
- not ansible_check_mode
|