Merge pull request #481 from bogdando/issue/479
Add retries for copying binaries from containers and packages
This commit is contained in:
commit
0bc957a689
5 changed files with 24 additions and 1 deletions
|
@ -27,6 +27,10 @@
|
||||||
id: "{{item}}"
|
id: "{{item}}"
|
||||||
keyserver: "{{docker_repo_key_info.keyserver}}"
|
keyserver: "{{docker_repo_key_info.keyserver}}"
|
||||||
state: present
|
state: present
|
||||||
|
register: keyserver_task_result
|
||||||
|
until: keyserver_task_result|success
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
with_items: "{{ docker_repo_key_info.repo_keys }}"
|
with_items: "{{ docker_repo_key_info.repo_keys }}"
|
||||||
when: ansible_os_family != "CoreOS"
|
when: ansible_os_family != "CoreOS"
|
||||||
|
|
||||||
|
@ -51,6 +55,10 @@
|
||||||
pkg: "{{item.name}}"
|
pkg: "{{item.name}}"
|
||||||
force: "{{item.force|default(omit)}}"
|
force: "{{item.force|default(omit)}}"
|
||||||
state: present
|
state: present
|
||||||
|
register: docker_task_result
|
||||||
|
until: docker_task_result|success
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
with_items: "{{ docker_package_info.pkgs }}"
|
with_items: "{{ docker_package_info.pkgs }}"
|
||||||
when: (ansible_os_family != "CoreOS") and (docker_package_info.pkgs|length > 0)
|
when: (ansible_os_family != "CoreOS") and (docker_package_info.pkgs|length > 0)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
/usr/bin/docker cp etcdctl-binarycopy:{{ etcd_container_bin_dir }}etcdctl {{ bin_dir }}/etcdctl &&
|
/usr/bin/docker cp etcdctl-binarycopy:{{ etcd_container_bin_dir }}etcdctl {{ bin_dir }}/etcdctl &&
|
||||||
/usr/bin/docker rm -f etcdctl-binarycopy"
|
/usr/bin/docker rm -f etcdctl-binarycopy"
|
||||||
when: etcd_deployment_type == "docker"
|
when: etcd_deployment_type == "docker"
|
||||||
|
register: etcd_task_result
|
||||||
|
until: etcd_task_result.rc == 0
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
#Plan B: looks nicer, but requires docker-py on all hosts:
|
#Plan B: looks nicer, but requires docker-py on all hosts:
|
||||||
|
|
|
@ -9,8 +9,11 @@
|
||||||
|
|
||||||
- name: Copy kubectl from hyperkube container
|
- name: Copy kubectl from hyperkube container
|
||||||
command: "/usr/bin/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp /hyperkube /systembindir/kubectl"
|
command: "/usr/bin/docker run --rm -v {{ bin_dir }}:/systembindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp /hyperkube /systembindir/kubectl"
|
||||||
|
register: kube_task_result
|
||||||
|
until: kube_task_result.rc == 0
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: kubectl_launcher
|
|
||||||
|
|
||||||
- name: Write kube-apiserver manifest
|
- name: Write kube-apiserver manifest
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -101,6 +101,10 @@
|
||||||
module: "{{ ansible_pkg_mgr }}"
|
module: "{{ ansible_pkg_mgr }}"
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: latest
|
state: latest
|
||||||
|
register: pkgs_task_result
|
||||||
|
until: pkgs_task_result|success
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
with_items: "{{required_pkgs | default([]) | union(common_required_pkgs|default([]))}}"
|
with_items: "{{required_pkgs | default([]) | union(common_required_pkgs|default([]))}}"
|
||||||
when: ansible_os_family != "CoreOS"
|
when: ansible_os_family != "CoreOS"
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,10 @@
|
||||||
|
|
||||||
- name: Calico | Copy cni plugins from hyperkube
|
- name: Calico | Copy cni plugins from hyperkube
|
||||||
command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
||||||
|
register: cni_task_result
|
||||||
|
until: cni_task_result.rc == 0
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ 20 | random + 3 }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: use_hyperkube_cni
|
when: use_hyperkube_cni
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue