Generate kubectl bash completion from kubectl instead of file

This commit is contained in:
Matthew Mosesohn 2016-11-14 12:22:46 +04:00
parent 3348434764
commit 976f095ef6
2 changed files with 15 additions and 3025 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,6 @@
--- ---
- include: pre-upgrade.yml - include: pre-upgrade.yml
- name: Copy kubectl bash completion
copy:
src: kubectl_bash_completion.sh
dest: /etc/bash_completion.d/kubectl.sh
when: ansible_os_family in ["Debian","RedHat"]
- 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"
@ -15,6 +10,21 @@
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
changed_when: false changed_when: false
- name: Gather kubectl bash completion
command: "{{ bin_dir }}/kubectl completion bash"
no_log: true
register: kubectl_bash_completion
when: ansible_os_family in ["Debian","RedHat"]
- name: Write kubectl bash completion
copy:
content: "{{ kubectl_bash_completion.stdout }}"
dest: /etc/bash_completion.d/kubectl.sh
owner: root
group: root
mode: 0755
when: ansible_os_family in ["Debian","RedHat"] and kubectl_bash_completion.changed
- name: Write kube-apiserver manifest - name: Write kube-apiserver manifest
template: template:
src: manifests/kube-apiserver.manifest.j2 src: manifests/kube-apiserver.manifest.j2