summaryrefslogtreecommitdiffstats
path: root/ansible/roles/kube-prometheus-stack/molecule/default
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/kube-prometheus-stack/molecule/default')
-rw-r--r--ansible/roles/kube-prometheus-stack/molecule/default/Dockerfile.j214
-rw-r--r--ansible/roles/kube-prometheus-stack/molecule/default/converge.yml7
-rw-r--r--ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml22
3 files changed, 43 insertions, 0 deletions
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/Dockerfile.j2 b/ansible/roles/kube-prometheus-stack/molecule/default/Dockerfile.j2
new file mode 100644
index 00000000..e6aa95d3
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/Dockerfile.j2
@@ -0,0 +1,14 @@
+# Molecule managed
+
+{% if item.registry is defined %}
+FROM {{ item.registry.url }}/{{ item.image }}
+{% else %}
+FROM {{ item.image }}
+{% endif %}
+
+RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
+ elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
+ elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
+ elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
+ elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
+ elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml b/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml
new file mode 100644
index 00000000..8662e436
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/converge.yml
@@ -0,0 +1,7 @@
+---
+- name: Converge
+ hosts: all
+ tasks:
+ - name: "Include kube-prometheus-stack"
+ include_role:
+ name: "kube-prometheus-stack"
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml b/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml
new file mode 100644
index 00000000..713e4d6c
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/molecule/default/molecule.yml
@@ -0,0 +1,22 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint: |
+ set -e
+ yamllint .
+ ansible-lint .
+ flake8
+platforms:
+ - name: infrastructure-kube-prometheus-stack
+ image: centos:7
+ groups:
+ - infrastructure
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ ANSIBLE_LIBRARY: ../../../../library
+verifier:
+ name: testinfra