blob: 3d63cb559108fd5db000d9b6ad0dffdd79ca6074 [file] [log] [blame]
Michal Ptacek11e2af52018-12-19 19:42:03 +00001---
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 Ptacek271cf3f2019-01-17 20:39:46 +000020
21- name: Install helm plugins if needed
22 block:
23 - name: Ensure that dir for helm plugins exists
24 file:
25 path: "~/.helm/plugins"
26 state: directory
27 mode: 0755
28 - name: Register all plugins to be inserted by dir names
29 find:
30 paths: "{{ app_helm_plugins_directory }}"
31 file_type: "directory"
32 register: list_of_plugins
33 - name: Install all helm plugins from {{ app_helm_plugins_directory }} dir
34 command: "{{ helm_bin_dir }}/helm plugin install {{ item.path }}"
35 with_items: "{{ list_of_plugins.files }}"
36 register: helm_plugin_install_result
37 failed_when: "helm_plugin_install_result.rc > 0 and helm_plugin_install_result.stderr != 'Error: plugin already exists'"
38 become: true
39 when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none
40
Michal Ptacekfabcad62019-02-04 06:38:08 +000041- name: "Execute custom role {{ application_pre_install_role }} if defined."
Michal Ptacek11e2af52018-12-19 19:42:03 +000042 include_tasks: custom_role.yml
43 vars:
44 application_custom_role: "{{ application_pre_install_role }}"
Michal Ptacek271cf3f2019-01-17 20:39:46 +000045