2021-05-03 22:16:03 +08:00
|
|
|
---
|
|
|
|
- name: Krew | Download krew
|
|
|
|
include_tasks: "../../../download/tasks/download_file.yml"
|
|
|
|
vars:
|
|
|
|
download: "{{ download_defaults | combine(downloads.krew) }}"
|
|
|
|
|
|
|
|
- name: Krew | krew env
|
|
|
|
template:
|
|
|
|
src: krew.j2
|
|
|
|
dest: /etc/bash_completion.d/krew
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2021-05-03 22:16:03 +08:00
|
|
|
|
|
|
|
- name: Krew | Copy krew manifest
|
|
|
|
template:
|
|
|
|
src: krew.yml.j2
|
|
|
|
dest: "{{ local_release_dir }}/krew.yml"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2021-05-03 22:16:03 +08:00
|
|
|
|
2023-06-30 17:51:57 +08:00
|
|
|
- name: Krew | Install krew # noqa command-instead-of-shell
|
2021-11-08 18:54:59 +08:00
|
|
|
shell: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} install --archive={{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz --manifest={{ local_release_dir }}/krew.yml"
|
2021-05-03 22:16:03 +08:00
|
|
|
environment:
|
|
|
|
KREW_ROOT: "{{ krew_root_dir }}"
|
|
|
|
KREW_DEFAULT_INDEX_URI: "{{ krew_default_index_uri | default('') }}"
|
2021-11-09 18:43:39 +08:00
|
|
|
|
|
|
|
- name: Krew | Get krew completion
|
|
|
|
command: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} completion bash"
|
|
|
|
changed_when: False
|
|
|
|
register: krew_completion
|
|
|
|
check_mode: False
|
2021-11-13 09:04:46 +08:00
|
|
|
ignore_errors: yes # noqa ignore-errors
|
2021-11-09 18:43:39 +08:00
|
|
|
|
|
|
|
- name: Krew | Install krew completion
|
|
|
|
copy:
|
|
|
|
dest: /etc/bash_completion.d/krew.sh
|
|
|
|
content: "{{ krew_completion.stdout }}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2021-11-13 09:04:46 +08:00
|
|
|
become: True
|
|
|
|
when: krew_completion.rc == 0
|