Fixing missing clause for enabling helm deploy

As a part of change merged recently in 271cf3ffc2977f9e4
support for OOM plugins was introduced however it was
never used. This commit is fixing this and introducing
helm deploy option if plugin exists.

Change-Id: Ifb77ce2098ea28f822e5e15ddf2736f0c83b946c
Signed-off-by: Michal Ptacek <m.ptacek@partner.samsung.com>
Signed-off-by: Milan Verespej <m.verespej@partner.samsung.com>
Issue-ID: OOM-1589
Signed-off-by: Milan Verespej <m.verespej@partner.samsung.com>
diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml
index d385b44..eaa40ce 100644
--- a/ansible/roles/application-install/tasks/install.yml
+++ b/ansible/roles/application-install/tasks/install.yml
@@ -38,5 +38,15 @@
   environment:
     PATH: "{{ helm_bin_dir }}:{{ ansible_env.PATH }}"
 
-- name: Helm Install application {{ app_name }}
-  command: "{{ helm_bin_dir }}/helm install {{ helm_repository_name }}/{{ app_helm_chart_name }} --name {{ app_helm_release_name }} --namespace {{ app_kubernetes_namespace }}"
+- name: Check for deploy plugin presence
+  stat:
+    path: '~/.helm/plugins/deploy/deploy.sh'
+  register: deploy_plugin_presence
+
+- name: "Helm Install application {{ app_name }}"
+  command: >
+          {{ helm_bin_dir }}/helm
+          {{ 'deploy' if deploy_plugin_presence.stat.exists else 'install --name' }}
+          {{ app_helm_release_name }}
+          {{ helm_repository_name }}/{{ app_helm_chart_name }}
+          --namespace {{ app_kubernetes_namespace }}
diff --git a/ansible/roles/application-install/tasks/pre-install.yml b/ansible/roles/application-install/tasks/pre-install.yml
index 88a95ea..3d63cb5 100644
--- a/ansible/roles/application-install/tasks/pre-install.yml
+++ b/ansible/roles/application-install/tasks/pre-install.yml
@@ -38,7 +38,7 @@
   become: true
   when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none
 
-- name: "Execute custome role {{ application_pre_install_role }} if defined."
+- name: "Execute custom role {{ application_pre_install_role }} if defined."
   include_tasks: custom_role.yml
   vars:
     application_custom_role: "{{ application_pre_install_role }}"