summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2021-02-11 21:46:59 +0000
committerGerrit Code Review <gerrit@onap.org>2021-02-11 21:46:59 +0000
commitdf09c2bf1e533a2c085a53eb46116bca9025c4fa (patch)
tree44cf3fc5167a427401f9d1bb1f82127f7279c6c0
parent9faac26f2d3b6b4fe2059d03756d1a7db5e9b1e2 (diff)
parentbbfb07116c060a6c3be1f5efc64b0706d98b255e (diff)
Merge "Move Helm v2 plugin installation logic into separate playbook"
-rw-r--r--ansible/roles/application/molecule/custom_role/molecule.yml1
-rw-r--r--ansible/roles/application/molecule/default/molecule.yml1
-rw-r--r--ansible/roles/application/molecule/ubuntu/molecule.yml1
-rw-r--r--ansible/roles/application/tasks/install-helm2-plugins.yml25
-rw-r--r--ansible/roles/application/tasks/transfer-helm-charts.yml27
5 files changed, 30 insertions, 25 deletions
diff --git a/ansible/roles/application/molecule/custom_role/molecule.yml b/ansible/roles/application/molecule/custom_role/molecule.yml
index f9b29d92..eeea94b3 100644
--- a/ansible/roles/application/molecule/custom_role/molecule.yml
+++ b/ansible/roles/application/molecule/custom_role/molecule.yml
@@ -29,6 +29,7 @@ provisioner:
app_helm_chart_name: "{{ app_name }}"
application_pre_install_role: application/test-patch-role
application_post_install_role: application/test-patch-role
+ helm_version: v2
lint:
name: ansible-lint
playbooks:
diff --git a/ansible/roles/application/molecule/default/molecule.yml b/ansible/roles/application/molecule/default/molecule.yml
index 30c752e2..9d4102b8 100644
--- a/ansible/roles/application/molecule/default/molecule.yml
+++ b/ansible/roles/application/molecule/default/molecule.yml
@@ -27,6 +27,7 @@ provisioner:
- all
- onap
app_helm_chart_name: "{{ app_name }}"
+ helm_version: v2
lint:
name: ansible-lint
scenario:
diff --git a/ansible/roles/application/molecule/ubuntu/molecule.yml b/ansible/roles/application/molecule/ubuntu/molecule.yml
index 2fde35a2..8552ce59 100644
--- a/ansible/roles/application/molecule/ubuntu/molecule.yml
+++ b/ansible/roles/application/molecule/ubuntu/molecule.yml
@@ -28,6 +28,7 @@ provisioner:
- all
- onap
app_helm_chart_name: "{{ app_name }}"
+ helm_version: v2
lint:
name: ansible-lint
playbooks:
diff --git a/ansible/roles/application/tasks/install-helm2-plugins.yml b/ansible/roles/application/tasks/install-helm2-plugins.yml
new file mode 100644
index 00000000..f1f900e3
--- /dev/null
+++ b/ansible/roles/application/tasks/install-helm2-plugins.yml
@@ -0,0 +1,25 @@
+---
+- name: Install helm plugins if needed
+ block:
+ - 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: true
+ mode: 0755
+ loop: "{{ list_of_plugins.files }}"
+ when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none
diff --git a/ansible/roles/application/tasks/transfer-helm-charts.yml b/ansible/roles/application/tasks/transfer-helm-charts.yml
index 56c95cc4..ac910735 100644
--- a/ansible/roles/application/tasks/transfer-helm-charts.yml
+++ b/ansible/roles/application/tasks/transfer-helm-charts.yml
@@ -20,28 +20,5 @@
src: "{{ app_helm_charts_install_directory }}.tgz"
dest: "{{ app_helm_charts_infra_directory }}"
-
-- name: Install helm plugins if needed
- block:
- - 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: true
- mode: 0755
- loop: "{{ list_of_plugins.files }}"
- when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none
+- include_tasks: install-helm2-plugins.yml
+ when: helm_version | regex_search("^v2" )