summaryrefslogtreecommitdiffstats
path: root/ansible/roles/application-install/tasks/pre-install.yml
diff options
context:
space:
mode:
authorMilan Verespej <m.verespej@partner.samsung.com>2019-02-08 15:30:39 +0100
committerMichal Ptacek <m.ptacek@partner.samsung.com>2019-02-11 18:44:48 +0000
commit5f5aa01c0f757ff3a9eb55eb978b98e45f23a079 (patch)
tree24a88089800cef02714df1a8929efe842a964adb /ansible/roles/application-install/tasks/pre-install.yml
parent55d8a890827a6b86937aa0d5181bb0b3bad70a8d (diff)
Change helm plugin install to copy module
Since helm plugin install command is not the most suitable for Ansible and it basically just creates link to plugin original location this change is using Ansible's copy module instead. Plugin is copied from install server because copy module doesn't support recursive directory copying with remote_src option. Issue-ID: OOM-1638 Change-Id: I9e9dcd8d33f8917296f576c2b34c0c576c9c126c Signed-off-by: Milan Verespej <m.verespej@partner.samsung.com>
Diffstat (limited to 'ansible/roles/application-install/tasks/pre-install.yml')
-rw-r--r--ansible/roles/application-install/tasks/pre-install.yml36
1 files changed, 21 insertions, 15 deletions
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