diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2021-02-16 12:39:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-16 12:39:51 +0000 |
commit | 8ec40e9842c856ed4c14d91755cc26b7c81b8f01 (patch) | |
tree | f1ee39c1d851be7eda03a1681a88b24a9691107c /ansible/roles/application/tasks/install-helm3-plugins.yml | |
parent | df09c2bf1e533a2c085a53eb46116bca9025c4fa (diff) | |
parent | 2c7299fa340e6918a59d92981f01652e9464ee86 (diff) |
Merge "Add Helm v3 plugin deployment playbook"
Diffstat (limited to 'ansible/roles/application/tasks/install-helm3-plugins.yml')
-rw-r--r-- | ansible/roles/application/tasks/install-helm3-plugins.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ansible/roles/application/tasks/install-helm3-plugins.yml b/ansible/roles/application/tasks/install-helm3-plugins.yml new file mode 100644 index 00000000..da402f31 --- /dev/null +++ b/ansible/roles/application/tasks/install-helm3-plugins.yml @@ -0,0 +1,33 @@ +--- +- name: Install helm plugins if needed + block: + - name: Get helm environment information + command: "{{ helm_bin_dir }}/helm env" + register: helm_env + - name: Set helm data dir + set_fact: + helm_data_dir: | + "{% if 'HELM_DATA_HOME' in helm_env.stdout %} + {{ (helm_env.stdout | replace('\"', '') | regex_search('HELM_DATA_HOME.*')).split('=')[1] }} + {% else %} + {{ '~/.local/share/helm' }} + {% endif %}" + - name: Ensure that dir for helm plugins exists + file: + path: "{{ helm_data_dir }}/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_data_dir }}/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 |