Michal Ptacek | 885988b | 2018-12-19 11:36:09 +0000 | [diff] [blame] | 1 | --- |
| 2 | - name: Install Helm |
Tomáš Levora | f6bd937 | 2019-06-14 10:54:39 +0200 | [diff] [blame] | 3 | unarchive: |
| 4 | src: "{{ app_data_path }}/downloads/helm-{{ helm_version }}-linux-amd64.tar.gz" |
Michal Ptacek | 885988b | 2018-12-19 11:36:09 +0000 | [diff] [blame] | 5 | dest: "{{ helm_bin_dir }}" |
Tomáš Levora | f6bd937 | 2019-06-14 10:54:39 +0200 | [diff] [blame] | 6 | extra_opts: |
| 7 | - --strip=1 |
| 8 | - --wildcards |
| 9 | - '*/helm' |
Michal Ptacek | 885988b | 2018-12-19 11:36:09 +0000 | [diff] [blame] | 10 | remote_src: true |
| 11 | mode: 0755 |
Bartek Grzybowski | b07d4a2 | 2021-02-01 10:48:54 +0100 | [diff] [blame] | 12 | |
| 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" ) |