Fix retries keyword missing until instruction (#5989)

pull/5999/head
Florian Ruynat 2020-04-21 16:20:56 +02:00 committed by GitHub
parent 2bec26dba5
commit ca45d5ffbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 2 deletions

View File

@ -36,6 +36,7 @@
{{ etcd_access_addresses.split(',') | first }}/v3alpha/kv/range {{ etcd_access_addresses.split(',') | first }}/v3alpha/kv/range
register: vault_etcd_exists register: vault_etcd_exists
retries: 4 retries: 4
until: vault_etcd_exists.status == 200
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
run_once: true run_once: true
when: not vault_is_running and vault_etcd_available when: not vault_is_running and vault_etcd_available

View File

@ -50,6 +50,8 @@
docker_image: docker_image:
name: quay.io/kubespray/cephfs-provisioner:06fddbe2 name: quay.io/kubespray/cephfs-provisioner:06fddbe2
push: yes push: yes
register: docker_image
retries: 10 retries: 10
until: docker_image is succeeded
when: check_image_result.rc != 0 when: check_image_result.rc != 0

View File

@ -24,6 +24,7 @@
register: kubeadm_upgrade register: kubeadm_upgrade
# Retry is because upload config sometimes fails # Retry is because upload config sometimes fails
retries: 3 retries: 3
until: kubeadm_upgrade.rc == 0
when: inventory_hostname == groups['kube-master']|first when: inventory_hostname == groups['kube-master']|first
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
notify: Master | restart kubelet notify: Master | restart kubelet

View File

@ -89,6 +89,7 @@
{{ bin_dir }}/calicoctl.sh get ippool | grep -w "{{ calico_pool_cidr | default(kube_pods_subnet) }}" | wc -l {{ bin_dir }}/calicoctl.sh get ippool | grep -w "{{ calico_pool_cidr | default(kube_pods_subnet) }}" | wc -l
register: calico_conf register: calico_conf
retries: 4 retries: 4
until: calico_conf.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
changed_when: false changed_when: false
when: when:
@ -203,7 +204,9 @@
"asNumber": "{{ item.as }}", "asNumber": "{{ item.as }}",
"peerIP": "{{ item.router_id }}" "peerIP": "{{ item.router_id }}"
}}' | {{ bin_dir }}/calicoctl.sh apply -f - }}' | {{ bin_dir }}/calicoctl.sh apply -f -
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
with_items: with_items:
- "{{ peers|selectattr('scope','defined')|selectattr('scope','equalto', 'global')|list|default([]) }}" - "{{ peers|selectattr('scope','defined')|selectattr('scope','equalto', 'global')|list|default([]) }}"
@ -223,7 +226,9 @@
"nodeSelector": "!has(i-am-a-route-reflector)", "nodeSelector": "!has(i-am-a-route-reflector)",
"peerSelector": "has(i-am-a-route-reflector)" "peerSelector": "has(i-am-a-route-reflector)"
}}' | {{ bin_dir }}/calicoctl.sh apply -f - }}' | {{ bin_dir }}/calicoctl.sh apply -f -
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
with_items: with_items:
- "{{ groups['calico-rr'] | default([]) }}" - "{{ groups['calico-rr'] | default([]) }}"
@ -243,7 +248,9 @@
"nodeSelector": "has(i-am-a-route-reflector)", "nodeSelector": "has(i-am-a-route-reflector)",
"peerSelector": "has(i-am-a-route-reflector)" "peerSelector": "has(i-am-a-route-reflector)"
}}' | {{ bin_dir }}/calicoctl.sh apply -f - }}' | {{ bin_dir }}/calicoctl.sh apply -f -
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
with_items: with_items:
- "{{ groups['calico-rr'] | default([]) }}" - "{{ groups['calico-rr'] | default([]) }}"
@ -316,7 +323,9 @@
}, },
"orchRefs":[{"nodeName":"{{ inventory_hostname }}","orchestrator":"k8s"}] "orchRefs":[{"nodeName":"{{ inventory_hostname }}","orchestrator":"k8s"}]
}}' | {{ bin_dir }}/calicoctl.sh apply -f - }}' | {{ bin_dir }}/calicoctl.sh apply -f -
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
when: when:
- peer_with_router|default(false) - peer_with_router|default(false)
@ -337,7 +346,9 @@
"node": "{{ inventory_hostname }}", "node": "{{ inventory_hostname }}",
"peerIP": "{{ item.router_id }}" "peerIP": "{{ item.router_id }}"
}}' | {{ bin_dir }}/calicoctl.sh apply -f - }}' | {{ bin_dir }}/calicoctl.sh apply -f -
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
with_items: with_items:
- "{{ peers|selectattr('scope','undefined')|list|default([]) | union(peers|selectattr('scope','defined')|selectattr('scope','equalto', 'node')|list|default([])) }}" - "{{ peers|selectattr('scope','undefined')|list|default([]) | union(peers|selectattr('scope','defined')|selectattr('scope','equalto', 'node')|list|default([])) }}"

View File

@ -31,7 +31,9 @@
{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \ {{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \
set /{{ cluster_name }}/network/config \ set /{{ cluster_name }}/network/config \
'{ "Network": "{{ kube_pods_subnet }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "{{ flannel_backend_type }}" } }' '{ "Network": "{{ kube_pods_subnet }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "{{ flannel_backend_type }}" } }'
register: output
retries: 4 retries: 4
until: output.rc == 0
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
delegate_to: "{{ groups['etcd'][0] }}" delegate_to: "{{ groups['etcd'][0] }}"
changed_when: false changed_when: false

View File

@ -31,7 +31,6 @@
state: 'stopped' state: 'stopped'
async: 120 async: 120
poll: 3 poll: 3
retries: 3
register: gce register: gce
- name: delete gce instances - name: delete gce instances
@ -46,5 +45,4 @@
state: 'absent' state: 'absent'
async: 120 async: 120
poll: 3 poll: 3
retries: 3
register: gce register: gce