diff options
Diffstat (limited to 'ansible_collections/community/grafana/molecule')
3 files changed, 195 insertions, 0 deletions
diff --git a/ansible_collections/community/grafana/molecule/default/converge.yml b/ansible_collections/community/grafana/molecule/default/converge.yml new file mode 100644 index 000000000..b1e1cf20b --- /dev/null +++ b/ansible_collections/community/grafana/molecule/default/converge.yml @@ -0,0 +1,48 @@ +--- +- name: Converge + hosts: localhost + environment: + http_proxy: "{{ lookup('env', 'HTTP_PROXY') | default(omit) }}" + https_proxy: "{{ lookup('env', 'HTTPS_PROXY') | default(omit) }}" + no_proxy: "{{ lookup('env', 'NO_PROXY') | default(omit) }}" + + vars: + grafana_url: http://localhost:3000 + grafana_username: admin + grafana_password: admin + + grafana_organizations: + - name: my_org + + grafana_datasources: + - name: Loki + ds_type: loki + ds_url: http://127.0.0.1:3100 + tls_skip_verify: true + + grafana_folders: + - name: my_service + - name: other_service + + grafana_teams: + - name: my_team + email: myteam@example.de + + grafana_users: + - name: Test User + login: testuser + password: supersecure!123 + email: testuser@example.de + + grafana_organization_users: + - login: testuser + org_id: 1 + - login: testuser + org_name: my_org + + grafana_dashboards: + - folder: my_service + path: test_dashboard.json + overwrite: true + + roles: [{role: community.grafana.grafana}] diff --git a/ansible_collections/community/grafana/molecule/default/molecule.yml b/ansible_collections/community/grafana/molecule/default/molecule.yml new file mode 100644 index 000000000..ab4613bcb --- /dev/null +++ b/ansible_collections/community/grafana/molecule/default/molecule.yml @@ -0,0 +1,21 @@ +--- +dependency: + name: galaxy +driver: + name: docker +platforms: + - name: instance + image: rndmh3ro/docker-debian12-ansible:latest + command: ${MOLECULE_DOCKER_COMMAND:-/lib/systemd/systemd} + env: + container: docker + pre_build_image: true + platform: amd64 +provisioner: + name: ansible + config_options: + defaults: + interpreter_python: auto_silent + callback_whitelist: profile_tasks, timer, yaml +verifier: + name: ansible diff --git a/ansible_collections/community/grafana/molecule/default/test_dashboard.json b/ansible_collections/community/grafana/molecule/default/test_dashboard.json new file mode 100644 index 000000000..b95184512 --- /dev/null +++ b/ansible_collections/community/grafana/molecule/default/test_dashboard.json @@ -0,0 +1,126 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 3, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "loki" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "datasource": { + "type": "loki" + }, + "refId": "A" + } + ], + "title": "Panel Title", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 33, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "New dashboard", + "uid": "ES5apb27k", + "version": 1, + "weekStart": "" +} |