benschubert.infrastructure.monitoring role – Configure all services required to monitor services and systems.
Note
This role is part of the benschubert.infrastructure collection (version 0.0.1).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it use: ansible-galaxy collection install benschubert.infrastructure
.
To use it in a playbook, specify: benschubert.infrastructure.monitoring
.
Entry point agent
– Configure a Grafana alloy service to monitor some systems
Synopsis
This role configures a Grafana Alloy container to monitor the provided services.
Parameters
Parameter |
Comments |
---|---|
The hostname at which the Authentik service is reachable |
|
The token to use to connect to Authentik |
|
The path on disk to a custom certificate to validate the TLS certificates when ansible makes requests if they are not available in the root certificate authorities |
|
The port at which the service is exposed via the ingress, in order to be able to make API calls to the service Default: |
|
Whether the TLS certificate should be verified when ansible makes API calls Choices:
|
|
The container image path and tag to use for Alloy Default: |
|
The path on disk where to store the agent’s configuration |
|
The path on disk where the agent can store it’s own data |
|
The networks that the agent should be joining |
|
The name of the pod to deploy the agent in. It will be also used to create a user in Authentik to allow access protected services |
|
A list of PostgreSQL databases to monitor Default: |
|
The name of the database to which to connect |
|
The hostname of the database to which to connect |
|
The password to use to connect to the database |
|
The username to use to connect to the database |
|
A human readable name of what this agent monitors. Used in alerting to group alerts together. |
|
A list of Prometheus endpoints to monitor Default: |
|
The endpoint on which to fetch the Prometheus metrics |
|
A Jinja template defining Prometheus rules to generate alerts The variable |
|
The path under which to scrape the metrics Default: |
|
A human-readable name for the service to monitor. Will be also used as the |
|
A list of Redis instances to monitor Default: |
|
The hostname of the Redis instance |
|
The password for the user to use for metrics collection on Redis, to use to authenticate. |
|
The username to use to authenticate against Redis |
|
A group name to which to add the role account that is created for monitoring the requested services. This is useful if you want to restrict apps per user, so you can have those bots publish their metrics correctly. |
|
The hostname at which to find the Mimir deployment |
Entry point dashboard
– Install the provided dashboard on Grafana
Synopsis
This role allows setting up a dashboard on Grafana
Parameters
Parameter |
Comments |
---|---|
The JSON content of the dashboard to setup |
|
The name of the dashboard on the file-system. Can contain one level of directory For example, |
|
The path to where the Grafana configuration is kept |
Entry point main
– Configure all services required to monitor services and systems.
Synopsis
This role configures a suite of services that are used to monitor services.
It will configure the following:
Mimir, including AlertManager
Parameters
Parameter |
Comments |
---|---|
The hostname at which the Authentik service is reachable |
|
The token to use to connect to Authentik |
|
The path on disk to a custom certificate to validate the TLS certificates when ansible makes requests if they are not available in the root certificate authorities |
|
The port at which the service is exposed via the ingress Default: |
|
The configuration for the certificate resolvers When created, it expects at least a ‘default’ entry, which will be used for all services that don’t specify an explicit resolver in their configuration ‘storage’ MUST be set as See Traefik’s documentation for more information Default: |
|
Whether the TLS certificate should be verified when ansible makes API calls Choices:
|
|
The password to give to the Grafana admin user |
|
The name of the group in Authentik that should be admins in Grafana Default: |
|
The password to authenticate as admin on Grafana for setting up dashboards and other resources Defaults to monitoring_grafana_admin_bootstrap_password if not set. Default: |
|
The name of the admin user for Grafana. This user will not exist on the Authentik service Default: |
|
A list of groups to restrict Grafana to. Users not in any of the specified groups won’t be able to see or login to Grafana.
When setting this, you should at least add |
|
The path to where the Grafana configuration is to be kept |
|
The directory in which the Grafana data will be stored |
|
The hostname at which the Grafana instance is reachable |
|
The container image path and tag to use for Grafana Default: |
|
The path on disk where the PostgreSQL instance for Grafana should store its data |
|
The container image path and tag to use for Postgres Default: |
|
The password used to connect to PostgreSQL database |
|
The secret key to use in Grafana to encrypt various sensitive data |
|
A list of groups to restrict Loki to. Users not in any of the specified groups won’t be able to see or login to Loki.
|
|
The path on disk where the Loki configuration files should be stored. |
|
The path on disk where the Loki data should be stored. |
|
The hostname at which the Loki instance is reachable. |
|
The container image path and tag to use for Loki Default: |
|
A list of additional podman networks that need to be attached to the Mimir pod. This is useful if you want to configure a SMTP gateway for sending emails via AlertManager. Default: |
|
The name of the template to use to configure the AlertManager routing Default: |
|
A list of groups to restrict Mimir to. Users not in any of the specified groups won’t be able to see or login to Mimir.
|
|
The path on disk where the Mimir configuration files should be stored. |
|
The path on disk where the Mimir data should be stored. |
|
The hostname at which the Mimir instance is reachable. |
|
The container image path and tag to use for Mimir Default: |
|
A list of secrets to inject into the Mimir container as <key: value> The secrets will be exposed under /run/secrets/monitoring-mimir-<key> with the key having ‘_’ replaced by ‘-’ Default: |
|
The container image path and tag to use for Alloy Default: |
|
The path at which the Grafana Alloy monitoring the monitoring stack should store its configuration |
|
The path at which the Grafana Alloy monitoring the monitoring stack should store its data |
|
A group name to which to add the role account that is created for monitoring the monitoring stack. This is useful if you want to restrict apps per user, so you can have those bots publish their metrics correctly. |