67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
---
|
|
- name: Create Helm temporary directory
|
|
file:
|
|
path: /tmp/helm
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Fetch Helm package
|
|
block:
|
|
- get_url:
|
|
url: 'https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz'
|
|
dest: /tmp/helm.tar.gz
|
|
checksum: '{{ helm_checksum }}'
|
|
|
|
rescue:
|
|
- copy:
|
|
src: "{{ role_path }}/utils/helm-v3.11.1-linux-amd64.tar.gz"
|
|
dest: /tmp/helm.tar.gz
|
|
|
|
- name: Extract Helm package
|
|
unarchive:
|
|
remote_src: true
|
|
src: /tmp/helm.tar.gz
|
|
dest: /tmp/helm
|
|
|
|
#- name: Ensure "docker" group exists
|
|
# group:
|
|
# name: docker
|
|
# state: present
|
|
# become: true
|
|
|
|
- name: Install helm to /usr/local/bin
|
|
copy:
|
|
remote_src: true
|
|
src: /tmp/helm/linux-amd64/helm
|
|
dest: /usr/local/bin/helm
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
become: true
|
|
|
|
- name: Cleanup Helm temporary directory
|
|
file:
|
|
path: /tmp/helm
|
|
state: absent
|
|
|
|
- name: Cleanup Helm temporary download
|
|
file:
|
|
path: /tmp/helm.tar.gz
|
|
state: absent
|
|
|
|
- name: Ensure bash_completion.d directory exists
|
|
file:
|
|
path: /etc/bash_completion.d
|
|
state: directory
|
|
mode: "0755"
|
|
become: true
|
|
|
|
- name: Setup Helm tab-completion
|
|
shell: |
|
|
set -o pipefail
|
|
/usr/local/bin/helm completion bash | tee /etc/bash_completion.d/helm
|
|
args:
|
|
executable: /bin/bash
|
|
changed_when: false
|
|
become: true
|