summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-01-28 15:46:57 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-02-04 08:15:41 +0000
commit14e400e35052b953e217145ae7d20151bcb05f04 (patch)
treef81cb7ef831023b83adffbc6b6f89b0a4da9abad /ansible
parent1b74568d89e5a6dc50e852ff70266944477d0eef (diff)
Add tasks to setup Helm v3 on infra node
Change-Id: I959184624f93753ff7217728c3c6011e82f91ef6 Issue-ID: OOM-2665 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/application/molecule/default/tests/test_default.py2
-rw-r--r--ansible/roles/application/tasks/setup-helm3.yml13
2 files changed, 15 insertions, 0 deletions
diff --git a/ansible/roles/application/molecule/default/tests/test_default.py b/ansible/roles/application/molecule/default/tests/test_default.py
index 1451a8fe..1bf36247 100644
--- a/ansible/roles/application/molecule/default/tests/test_default.py
+++ b/ansible/roles/application/molecule/default/tests/test_default.py
@@ -23,6 +23,8 @@ overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
--timeout 1800"""
elif helm_release == 'v3':
expected_content = """env
+repo list
+repo add local http://127.0.0.1:8879
deploy moleculetestapp local/moleculetestapp --namespace \
moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
diff --git a/ansible/roles/application/tasks/setup-helm3.yml b/ansible/roles/application/tasks/setup-helm3.yml
index ce8cbb3a..4b50ec1c 100644
--- a/ansible/roles/application/tasks/setup-helm3.yml
+++ b/ansible/roles/application/tasks/setup-helm3.yml
@@ -1,4 +1,17 @@
---
+- name: List helm repos
+ command: "{{ helm_bin_dir }}/helm repo list"
+ register: helm_repo_list
+ changed_when: false # for idempotency
+ failed_when:
+ - helm_repo_list.rc > 0
+ - "'Error: no repositories to show' not in helm_repo_list.stderr"
+
+- name: Helm Add Repo
+ command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name | mandatory }} {{ helm_repository_url | mandatory }}"
+ when: "'local' not in helm_repo_list.stdout"
+ changed_when: true # when executed its a changed type of action
+
- name: Check for deploy plugin presence
stat:
path: '{{ helm_data_dir }}/plugins/deploy/deploy.sh'