summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/application/molecule/default/tests/test_default.py4
-rw-r--r--ansible/roles/application/tasks/install-helm3-plugins.yml8
2 files changed, 8 insertions, 4 deletions
diff --git a/ansible/roles/application/molecule/default/tests/test_default.py b/ansible/roles/application/molecule/default/tests/test_default.py
index 1bf36247..be9b4cdf 100644
--- a/ansible/roles/application/molecule/default/tests/test_default.py
+++ b/ansible/roles/application/molecule/default/tests/test_default.py
@@ -21,6 +21,7 @@ deploy moleculetestapp local/moleculetestapp --namespace \
moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
--timeout 1800"""
+ expected_plugin_path = '/plugins/deploy/deploy.sh'
elif helm_release == 'v3':
expected_content = """env
repo list
@@ -29,7 +30,10 @@ deploy moleculetestapp local/moleculetestapp --namespace \
moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
--timeout 1800"""
+ expected_plugin_path = '/root/.local/share/helm/plugins/deploy/' +\
+ 'deploy.sh'
assert fc == expected_content
+ assert host.file(expected_plugin_path).exists
def test_helm_override_file(host):
diff --git a/ansible/roles/application/tasks/install-helm3-plugins.yml b/ansible/roles/application/tasks/install-helm3-plugins.yml
index da402f31..5d933ed2 100644
--- a/ansible/roles/application/tasks/install-helm3-plugins.yml
+++ b/ansible/roles/application/tasks/install-helm3-plugins.yml
@@ -6,12 +6,12 @@
register: helm_env
- name: Set helm data dir
set_fact:
- helm_data_dir: |
- "{% if 'HELM_DATA_HOME' in helm_env.stdout %}
+ helm_data_dir:
+ "{% if 'HELM_DATA_HOME' in helm_env.stdout -%}
{{ (helm_env.stdout | replace('\"', '') | regex_search('HELM_DATA_HOME.*')).split('=')[1] }}
- {% else %}
+ {%- else -%}
{{ '~/.local/share/helm' }}
- {% endif %}"
+ {%- endif %}"
- name: Ensure that dir for helm plugins exists
file:
path: "{{ helm_data_dir }}/plugins"