use rsync instead of command

This commit is contained in:
Smaine Kahlouch
2016-01-23 18:26:07 +01:00
parent 87d8d87c6e
commit 4984b57aa2
8 changed files with 47 additions and 20 deletions

View File

@@ -15,16 +15,15 @@
notify: restart kubelet
- name: install | Install kubelet binary
command: cp -pf "{{ local_release_dir }}/kubernetes/bin/kubelet" "{{ bin_dir }}/kubelet"
command: rsync -piu "{{ local_release_dir }}/kubernetes/bin/kubelet" "{{ bin_dir }}/kubelet"
register: kubelet_copy
changed_when: false
notify: restart kubelet
- name: install | Calico-plugin | Directory
file: path=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/ state=directory
when: kube_network_plugin == "calico"
- name: install | Calico-plugin | Binary
command: cp -pf "{{ local_release_dir }}/calico/bin/calico" "/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico"
command: rsync -piu "{{ local_release_dir }}/calico/bin/calico" "/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico"
when: kube_network_plugin == "calico"
changed_when: false
notify: restart kubelet

View File

@@ -45,6 +45,11 @@
src: manifests/kube-proxy.manifest.j2
dest: "{{ kube_manifest_dir }}/kube-proxy.manifest"
- name: Restart kubelet if binary changed
command: /bin/true
notify: restart kubelet
when: kubelet_copy.stdout_lines
- name: Enable kubelet
service:
name: kubelet