summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-06-01 13:13:27 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-06-01 13:17:01 +0000
commita466ed6a85faed331e4ad7645be86d1e63c04bc4 (patch)
tree3bb1c4a20f2765a099083e7975ae292932c6d105 /ansible
parent3f3a7a1e6bd371306eda9dc26ad6fad76cce4029 (diff)
[ANSIBLE] Add 'kube-prometheus-stack' role skeleton
Change-Id: I413186d6dc78baea4d1f22e4ed2f419f6e49bd25 Issue-ID: INT-1926 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/kube-prometheus-stack/.yamllint12
-rw-r--r--ansible/roles/kube-prometheus-stack/defaults/main.yml2
-rw-r--r--ansible/roles/kube-prometheus-stack/handlers/main.yml2
-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
-rw-r--r--ansible/roles/kube-prometheus-stack/tasks/main.yml2
-rw-r--r--ansible/roles/kube-prometheus-stack/vars/main.yml2
8 files changed, 63 insertions, 0 deletions
diff --git a/ansible/roles/kube-prometheus-stack/.yamllint b/ansible/roles/kube-prometheus-stack/.yamllint
new file mode 100644
index 00000000..c5ae64be
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/.yamllint
@@ -0,0 +1,12 @@
+---
+extends: default
+
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
+ truthy: disable
diff --git a/ansible/roles/kube-prometheus-stack/defaults/main.yml b/ansible/roles/kube-prometheus-stack/defaults/main.yml
new file mode 100644
index 00000000..ccb68039
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+# defaults file for kube-prometheus-stack
diff --git a/ansible/roles/kube-prometheus-stack/handlers/main.yml b/ansible/roles/kube-prometheus-stack/handlers/main.yml
new file mode 100644
index 00000000..a201a218
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/handlers/main.yml
@@ -0,0 +1,2 @@
+---
+# handlers file for kube-prometheus-stack
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
diff --git a/ansible/roles/kube-prometheus-stack/tasks/main.yml b/ansible/roles/kube-prometheus-stack/tasks/main.yml
new file mode 100644
index 00000000..cf52b66f
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+# tasks file for kube-prometheus-stack
diff --git a/ansible/roles/kube-prometheus-stack/vars/main.yml b/ansible/roles/kube-prometheus-stack/vars/main.yml
new file mode 100644
index 00000000..cfc8e1a5
--- /dev/null
+++ b/ansible/roles/kube-prometheus-stack/vars/main.yml
@@ -0,0 +1,2 @@
+---
+# vars file for kube-prometheus-stack