diff options
Diffstat (limited to 'ansible')
-rwxr-xr-x | ansible/group_vars/all.yml | 2 | ||||
-rw-r--r-- | ansible/roles/application-install/tasks/install.yml | 2 | ||||
-rw-r--r-- | ansible/roles/application-install/tasks/pre-install.yml | 36 |
3 files changed, 23 insertions, 17 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 0a73b637..e70a837b 100755 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -114,7 +114,7 @@ app_helm_build_targets: # Directory with helm plugins # It's an optional parameter used e.g. in OOM Casablanca -# app_helm_plugins_directory: "{{ app_helm_charts_infra_directory}}/kubernetes/helm/plugins/" +# app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/kubernetes/helm/plugins/" app_helm_plugins_directory: # Helm release name (visible in POD names) used by Helm diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml index ab17aba4..5246bf2f 100644 --- a/ansible/roles/application-install/tasks/install.yml +++ b/ansible/roles/application-install/tasks/install.yml @@ -55,7 +55,7 @@ - name: Check for deploy plugin presence stat: - path: '~/.helm/plugins/deploy/deploy.sh' + path: '{{ helm_home_dir.stdout }}/plugins/deploy/deploy.sh' register: deploy_plugin_presence - name: "Helm Install application {{ app_name }}" diff --git a/ansible/roles/application-install/tasks/pre-install.yml b/ansible/roles/application-install/tasks/pre-install.yml index 3d63cb55..f87ade33 100644 --- a/ansible/roles/application-install/tasks/pre-install.yml +++ b/ansible/roles/application-install/tasks/pre-install.yml @@ -20,21 +20,27 @@ - name: Install helm plugins if needed block: - - name: Ensure that dir for helm plugins exists - file: - path: "~/.helm/plugins" - state: directory - mode: 0755 - - name: Register all plugins to be inserted by dir names - find: - paths: "{{ app_helm_plugins_directory }}" - file_type: "directory" - register: list_of_plugins - - name: Install all helm plugins from {{ app_helm_plugins_directory }} dir - command: "{{ helm_bin_dir }}/helm plugin install {{ item.path }}" - with_items: "{{ list_of_plugins.files }}" - register: helm_plugin_install_result - failed_when: "helm_plugin_install_result.rc > 0 and helm_plugin_install_result.stderr != 'Error: plugin already exists'" + - name: Get helm dir + command: "{{ helm_bin_dir }}/helm home" + register: helm_home_dir + - name: Ensure that dir for helm plugins exists + file: + path: "{{ helm_home_dir.stdout }}/plugins" + state: directory + mode: 0755 + - name: Register all plugins to be inserted by dir names + find: + paths: "{{ app_helm_plugins_directory }}" + file_type: "directory" + register: list_of_plugins + delegate_to: localhost + - name: Install all helm plugins from {{ app_helm_plugins_directory }} dir + copy: + src: "{{ item.path }}" + dest: "{{ helm_home_dir.stdout }}"/plugins" + directory_mode: yes + mode: 0755 + with_items: "{{ list_of_plugins.files }}" become: true when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none |