summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2019-01-17 20:39:46 +0000
committerMichal Ptacek <m.ptacek@partner.samsung.com>2019-01-27 13:03:30 +0100
commit271cf3ffc2977f9e4825842a953b9a8e3ab27141 (patch)
tree42559f723ec211525ca8e167b82ab3b6bb31611d /ansible/roles
parentb5cd82b2ec6f4fe69eae27f70eb3b5eda52da368 (diff)
Adding support for helm plugins
Proprietary plugins can be used along with helm, in addition to that building of local helm repository can be achieved by using different target or list of targets. Change-Id: If421133b9cc8bcfa47c3e7c14e6712520231e39c Signed-off-by: Michal Ptacek <m.ptacek@partner.samsung.com> Issue-ID: OOM-1589
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/application-install/tasks/install.yml5
-rw-r--r--ansible/roles/application-install/tasks/pre-install.yml22
2 files changed, 25 insertions, 2 deletions
diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml
index 7ff6b62c..d385b448 100644
--- a/ansible/roles/application-install/tasks/install.yml
+++ b/ansible/roles/application-install/tasks/install.yml
@@ -30,10 +30,11 @@
- name: Helm Add Repo
command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name }} {{ helm_repository_url }}"
-- name: Helm Make All
+- name: Build local helm repository
make:
chdir: "{{ app_helm_charts_infra_directory }}"
- target: all
+ target: "{{ item }}"
+ with_items: "{{ app_helm_build_targets }}"
environment:
PATH: "{{ helm_bin_dir }}:{{ ansible_env.PATH }}"
diff --git a/ansible/roles/application-install/tasks/pre-install.yml b/ansible/roles/application-install/tasks/pre-install.yml
index b782ca76..88a95ea6 100644
--- a/ansible/roles/application-install/tasks/pre-install.yml
+++ b/ansible/roles/application-install/tasks/pre-install.yml
@@ -17,7 +17,29 @@
src: "{{ app_helm_charts_install_directory }}.tgz"
dest: "{{ app_helm_charts_infra_directory }}"
+
+- 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'"
+ 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."
include_tasks: custom_role.yml
vars:
application_custom_role: "{{ application_pre_install_role }}"
+