46 lines
972 B
YAML
46 lines
972 B
YAML
- name: create directory
|
|
file:
|
|
path: /opt/helm
|
|
state: directory
|
|
|
|
- name: create directory
|
|
file:
|
|
path: /opt/helm/{{ helm_version }}
|
|
state: directory
|
|
|
|
- name: get archive
|
|
get_url:
|
|
url: https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz
|
|
dest: /tmp/helm.tar.gz
|
|
|
|
- name: unpack archive
|
|
unarchive:
|
|
src: /tmp/helm.tar.gz
|
|
remote_src: yes
|
|
dest: /opt/helm/{{ helm_version }}
|
|
extra_opts:
|
|
- "--strip-components"
|
|
- "1"
|
|
creates: /opt/helm/{{ helm_version }}/helm
|
|
|
|
- name: create symlink
|
|
file:
|
|
path: /usr/local/bin/helm
|
|
src: /opt/helm/{{ helm_version }}/helm
|
|
state: link
|
|
|
|
- name: generate completions
|
|
command:
|
|
cmd: /opt/helm/{{ helm_version }}/helm completion bash
|
|
register: completion
|
|
|
|
- name: copy completions to filesystem
|
|
copy:
|
|
content: "{{ completion.stdout }}"
|
|
dest: /etc/bash_completion.d/helm
|
|
|
|
- name: delete archive
|
|
file:
|
|
path: /tmp/helm.tar.gz
|
|
state: absent
|