elan.monitoring_prometheus

Ansible Role for Prometheus

Molecule

This guide helps you install the latest version of Prometheus using Ansible. This role is similar to Prometheus RPM but works on multiple operating systems.

Role Variables

You can choose which configuration file templates to use. The role will install a default configuration, but you will probably want to customize it. To use your own configuration file, set the path to your Jinja template in the variable prometheus_config_template.

It also installs an .env file that defines how Prometheus is run with systemd. You can provide your own file by setting the prometheus_env_file variable, allowing you to customize it.

Example Playbook

To use this role in your playbook, simply add it like this:

- hosts: all
  become: true
  roles:
    - role: elan.monitoring_prometheus
      prometheus_config_template: 'custom_templates/prometheus.yml.j2'

Development

For testing and development, you can use Molecule. If you are using Podman as the driver, you can install it like this (if using Docker, replace podman with docker):

pip install -r .dev_requirements.txt

You can then create test instances, apply the Ansible configuration, and destroy the test instances with the following commands:

molecule create
molecule converge
molecule destroy

To inspect a running test instance, use molecule login --host <instance_name>, replacing <instance_name> with the name of the instance you want to check.

License

BSD-3-Clause

Author Information

ELAN e.V

Informazioni sul progetto

install prometheus

Installa
ansible-galaxy install elan.monitoring_prometheus
Licenza
bsd-3-clause
Download
4.1k
Proprietario
elan e.V. is a German non-profit organization helping universities and other higher education organizations with all things related to e-learning