summaryrefslogtreecommitdiffstats
path: root/ansible/roles/application/molecule
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-01-22 15:09:51 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-01-26 08:34:31 +0000
commit2c7299fa340e6918a59d92981f01652e9464ee86 (patch)
tree46c8488ec1882efe5a29f7a32b42a23e09d5dd4b /ansible/roles/application/molecule
parentbbfb07116c060a6c3be1f5efc64b0706d98b255e (diff)
Add Helm v3 plugin deployment playbook
Change-Id: I3999dd64dd87f163a3306b74cec88019d821759e Issue-ID: OOM-2665 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/application/molecule')
-rw-r--r--ansible/roles/application/molecule/default/tests/test_default.py7
l---------ansible/roles/application/molecule/helm3/Dockerfile.j21
-rw-r--r--ansible/roles/application/molecule/helm3/molecule.yml54
l---------ansible/roles/application/molecule/helm3/tests1
4 files changed, 62 insertions, 1 deletions
diff --git a/ansible/roles/application/molecule/default/tests/test_default.py b/ansible/roles/application/molecule/default/tests/test_default.py
index 22298e3a..21fc40e4 100644
--- a/ansible/roles/application/molecule/default/tests/test_default.py
+++ b/ansible/roles/application/molecule/default/tests/test_default.py
@@ -8,7 +8,12 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_helm_commands(host):
fc = host.file('/tmp/helm_simu_output').content_string
- expected_content = """home
+ helm_release = host.ansible.get_variables()['helm_version']
+ if helm_release == 'v2':
+ content_str1 = 'home'
+ elif helm_release == 'v3':
+ content_str1 = 'env'
+ expected_content = content_str1 + """
init --upgrade --skip-refresh
version --tiller-connection-timeout 10
repo list
diff --git a/ansible/roles/application/molecule/helm3/Dockerfile.j2 b/ansible/roles/application/molecule/helm3/Dockerfile.j2
new file mode 120000
index 00000000..867ec5c3
--- /dev/null
+++ b/ansible/roles/application/molecule/helm3/Dockerfile.j2
@@ -0,0 +1 @@
+../default/Dockerfile.j2 \ No newline at end of file
diff --git a/ansible/roles/application/molecule/helm3/molecule.yml b/ansible/roles/application/molecule/helm3/molecule.yml
new file mode 100644
index 00000000..fce59098
--- /dev/null
+++ b/ansible/roles/application/molecule/helm3/molecule.yml
@@ -0,0 +1,54 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: instance-helm3
+ image: centos:7
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ inventory:
+ group_vars:
+ all:
+ app_name: moleculetestapp
+ app_data_path: "/opt/{{ app_name }}"
+ app_helm_release_name: "{{ app_name }}"
+ app_kubernetes_namespace: "{{ app_name }}"
+ app_helm_charts_install_directory: application/helm_charts
+ app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/helm/plugins/"
+ app_helm_charts_infra_directory: "{{ app_data_path }}/helm_charts"
+ helm_bin_dir: /usr/local/bin
+ app_helm_build_targets:
+ - all
+ - onap
+ app_helm_chart_name: "{{ app_name }}"
+ helm_version: v3
+ lint:
+ name: ansible-lint
+ playbooks:
+ prepare: ../default/prepare.yml
+ converge: ../default/playbook.yml
+ cleanup: ../default/cleanup.yml
+scenario:
+ name: helm3
+ test_sequence:
+ - lint
+ - cleanup
+ - destroy
+ - dependency
+ - syntax
+ - create
+ - prepare
+ - converge
+ - verify
+ - cleanup
+ - destroy
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/application/molecule/helm3/tests b/ansible/roles/application/molecule/helm3/tests
new file mode 120000
index 00000000..b8ac4407
--- /dev/null
+++ b/ansible/roles/application/molecule/helm3/tests
@@ -0,0 +1 @@
+../default/tests/ \ No newline at end of file