diff options
Diffstat (limited to 'ansible/roles')
l--------- | ansible/roles/helm/molecule/helm3/Dockerfile.j2 | 1 | ||||
-rw-r--r-- | ansible/roles/helm/molecule/helm3/molecule.yml | 31 | ||||
l--------- | ansible/roles/helm/molecule/helm3/playbook.yml | 1 | ||||
l--------- | ansible/roles/helm/molecule/helm3/prepare.yml | 1 | ||||
-rw-r--r-- | ansible/roles/helm/molecule/helm3/vars.yml | 2 | ||||
-rw-r--r-- | ansible/roles/helm/tasks/main.yml | 29 |
6 files changed, 65 insertions, 0 deletions
diff --git a/ansible/roles/helm/molecule/helm3/Dockerfile.j2 b/ansible/roles/helm/molecule/helm3/Dockerfile.j2 new file mode 120000 index 00000000..867ec5c3 --- /dev/null +++ b/ansible/roles/helm/molecule/helm3/Dockerfile.j2 @@ -0,0 +1 @@ +../default/Dockerfile.j2
\ No newline at end of file diff --git a/ansible/roles/helm/molecule/helm3/molecule.yml b/ansible/roles/helm/molecule/helm3/molecule.yml new file mode 100644 index 00000000..e8634477 --- /dev/null +++ b/ansible/roles/helm/molecule/helm3/molecule.yml @@ -0,0 +1,31 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: + name: yamllint +platforms: + - name: infrastructure-server-helm3 + image: centos:7 + groups: + - infrastructure +provisioner: + name: ansible + lint: + name: ansible-lint + env: + ANSIBLE_ROLES_PATH: ../../../../test/roles + ANSIBLE_LIBRARY: ../../../../library + inventory: + group_vars: + all: + app_name: onap + app_data_path: "/opt/{{ app_name }}" +scenario: + name: helm3 +verifier: + name: testinfra + lint: + name: flake8 + directory: ../default/tests diff --git a/ansible/roles/helm/molecule/helm3/playbook.yml b/ansible/roles/helm/molecule/helm3/playbook.yml new file mode 120000 index 00000000..a3e26797 --- /dev/null +++ b/ansible/roles/helm/molecule/helm3/playbook.yml @@ -0,0 +1 @@ +../default/playbook.yml
\ No newline at end of file diff --git a/ansible/roles/helm/molecule/helm3/prepare.yml b/ansible/roles/helm/molecule/helm3/prepare.yml new file mode 120000 index 00000000..1c017d9a --- /dev/null +++ b/ansible/roles/helm/molecule/helm3/prepare.yml @@ -0,0 +1 @@ +../default/prepare.yml
\ No newline at end of file diff --git a/ansible/roles/helm/molecule/helm3/vars.yml b/ansible/roles/helm/molecule/helm3/vars.yml new file mode 100644 index 00000000..7ff37715 --- /dev/null +++ b/ansible/roles/helm/molecule/helm3/vars.yml @@ -0,0 +1,2 @@ +--- +helm_version: v3.3.4 diff --git a/ansible/roles/helm/tasks/main.yml b/ansible/roles/helm/tasks/main.yml index c1b47103..64db7850 100644 --- a/ansible/roles/helm/tasks/main.yml +++ b/ansible/roles/helm/tasks/main.yml @@ -9,3 +9,32 @@ - '*/helm' remote_src: true mode: 0755 + +- name: Install helm-push plugin if runing with Helm v3 + block: + - name: Get helm environment information + command: "{{ helm_bin_dir }}/helm env" + register: helm_env + changed_when: false # for idempotency + + - name: Set helm plugin dir fact + set_fact: + helm_plugin_dir: + "{% if 'HELM_PLUGINS' in helm_env.stdout -%} + {{ (helm_env.stdout | replace('\"', '') | regex_search('HELM_PLUGINS.*')).split('=')[1] }} + {%- else -%} + {{ '~/.local/share/helm/plugins' }} + {%- endif %}" + + - name: Ensure that plugin directory exists + file: + path: "{{ helm_plugin_dir }}/helm-push" + state: directory + mode: 0755 + + - name: Deploy helm-push plugin + unarchive: + src: "{{ app_data_path }}/downloads/helm-push_{{ helm3_push_version }}_linux_amd64.tar.gz" + dest: "{{ helm_plugin_dir }}/helm-push" + remote_src: true + when: helm_version | regex_search("^v3" ) |