Michal Ptacek | 11e2af5 | 2018-12-19 19:42:03 +0000 | [diff] [blame] | 1 | --- |
| 2 | # before custom specific code is executed we need to move helm charts to infra |
| 3 | - name: Distribute helm charts to infra node |
| 4 | block: |
| 5 | - name: Archive helm charts |
| 6 | archive: |
| 7 | path: "{{ app_helm_charts_install_directory }}/*" |
| 8 | dest: "{{ app_helm_charts_install_directory }}.tgz" |
| 9 | delegate_to: localhost |
| 10 | - name: Create helm charts dir on infra |
| 11 | file: |
| 12 | path: "{{ app_helm_charts_infra_directory }}" |
| 13 | state: directory |
| 14 | mode: 0755 |
| 15 | - name: Unarchive helm charts on infra node |
| 16 | unarchive: |
| 17 | src: "{{ app_helm_charts_install_directory }}.tgz" |
| 18 | dest: "{{ app_helm_charts_infra_directory }}" |
| 19 | |
Michal Ptacek | 271cf3f | 2019-01-17 20:39:46 +0000 | [diff] [blame] | 20 | |
| 21 | - name: Install helm plugins if needed |
| 22 | block: |
Milan Verespej | 5f5aa01 | 2019-02-08 15:30:39 +0100 | [diff] [blame] | 23 | - name: Get helm dir |
| 24 | command: "{{ helm_bin_dir }}/helm home" |
| 25 | register: helm_home_dir |
| 26 | - name: Ensure that dir for helm plugins exists |
| 27 | file: |
| 28 | path: "{{ helm_home_dir.stdout }}/plugins" |
| 29 | state: directory |
| 30 | mode: 0755 |
| 31 | - name: Register all plugins to be inserted by dir names |
| 32 | find: |
| 33 | paths: "{{ app_helm_plugins_directory }}" |
| 34 | file_type: "directory" |
| 35 | register: list_of_plugins |
| 36 | delegate_to: localhost |
| 37 | - name: Install all helm plugins from {{ app_helm_plugins_directory }} dir |
| 38 | copy: |
| 39 | src: "{{ item.path }}" |
Milan Verespej | 0e4353b | 2019-02-14 14:15:38 +0100 | [diff] [blame] | 40 | dest: "{{ helm_home_dir.stdout }}/plugins" |
Samuli Silvius | 51d7d01 | 2019-03-19 08:45:54 +0200 | [diff] [blame^] | 41 | directory_mode: true |
Milan Verespej | 5f5aa01 | 2019-02-08 15:30:39 +0100 | [diff] [blame] | 42 | mode: 0755 |
| 43 | with_items: "{{ list_of_plugins.files }}" |
Michal Ptacek | 271cf3f | 2019-01-17 20:39:46 +0000 | [diff] [blame] | 44 | when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none |