[MOLECULE] Setup Molecule for kube-prometheus-stack role
Change-Id: Id1c40e6a7da0ad0c42b162835f09630630569dd2
Issue-ID: INT-1926
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml b/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml
index 8662e43..c921d63 100644
--- a/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml
@@ -1,6 +1,9 @@
---
- name: Converge
hosts: all
+ pre_tasks:
+ - name: Include infrastructure group variables
+ include_vars: ../../../../group_vars/infrastructure.yml
tasks:
- name: "Include kube-prometheus-stack"
include_role:
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml b/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml
index 713e4d6..17bfcd3 100644
--- a/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml
@@ -18,5 +18,10 @@
env:
ANSIBLE_ROLES_PATH: ../../../../test/roles
ANSIBLE_LIBRARY: ../../../../library
+ inventory:
+ group_vars:
+ all:
+ app_name: onap
+ app_data_path: "/opt/{{ app_name }}"
verifier:
name: testinfra
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/prepare.yml b/ansible/roles/kube-prometheus-stack/molecule/default/prepare.yml
new file mode 100644
index 0000000..dc7e040
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/prepare.yml
@@ -0,0 +1,10 @@
+---
+- name: Prepare infra for kube-prometheus-stack role
+ hosts: all
+ pre_tasks:
+ - name: Include infrastructure group variables
+ include_vars: ../../../../group_vars/infrastructure.yml
+ tasks:
+ - name: "Include prepare-kube-prometheus-stack"
+ include_role:
+ name: "prepare-kube-prometheus-stack"