blob: 64db7850ff46d4b5b1995d2d3095bdf21e36af02 [file] [log] [blame]
Michal Ptacek885988b2018-12-19 11:36:09 +00001---
2- name: Install Helm
Tomáš Levoraf6bd9372019-06-14 10:54:39 +02003 unarchive:
4 src: "{{ app_data_path }}/downloads/helm-{{ helm_version }}-linux-amd64.tar.gz"
Michal Ptacek885988b2018-12-19 11:36:09 +00005 dest: "{{ helm_bin_dir }}"
Tomáš Levoraf6bd9372019-06-14 10:54:39 +02006 extra_opts:
7 - --strip=1
8 - --wildcards
9 - '*/helm'
Michal Ptacek885988b2018-12-19 11:36:09 +000010 remote_src: true
11 mode: 0755
Bartek Grzybowskib07d4a22021-02-01 10:48:54 +010012
13- name: Install helm-push plugin if runing with Helm v3
14 block:
15 - name: Get helm environment information
16 command: "{{ helm_bin_dir }}/helm env"
17 register: helm_env
18 changed_when: false # for idempotency
19
20 - name: Set helm plugin dir fact
21 set_fact:
22 helm_plugin_dir:
23 "{% if 'HELM_PLUGINS' in helm_env.stdout -%}
24 {{ (helm_env.stdout | replace('\"', '') | regex_search('HELM_PLUGINS.*')).split('=')[1] }}
25 {%- else -%}
26 {{ '~/.local/share/helm/plugins' }}
27 {%- endif %}"
28
29 - name: Ensure that plugin directory exists
30 file:
31 path: "{{ helm_plugin_dir }}/helm-push"
32 state: directory
33 mode: 0755
34
35 - name: Deploy helm-push plugin
36 unarchive:
37 src: "{{ app_data_path }}/downloads/helm-push_{{ helm3_push_version }}_linux_amd64.tar.gz"
38 dest: "{{ helm_plugin_dir }}/helm-push"
39 remote_src: true
40 when: helm_version | regex_search("^v3" )