elan.monitoring_prometheus

Ansible Role for prometheus

molecule

Install the latest prometheus version with ansible. This role is the multi-os ansible equivalent of https://github.com/lkiesow/prometheus-rpm.

Role Variables

You can specify which template files to use for your configuration. The role installs the default configuration, which you will likely want to extend or change. To pass your own configuration file, specify the path to the jinja template in the variable prometheus_config_template.

Additionally, an .env-file is installed that expands the command line arguments of how prometheus is called by systemd. Here you can also pass your individual file via the variable prometheus_env_file, so you are not limited to these values.

Example Playbook

Just add the role to your playbook:

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

Development

For development and testing you can use molecule. With podman as driver you can install it like this – preferably in a virtual environment (if you use docker, substitute podman with docker):

pip install -r .dev_requirements.txt

Then you can create the test instances, apply the ansible config (converge) and destroy the test instances with these commands:

molecule create
molecule converge
molecule destroy

If you want to inspect a running test instance use molecule login --host <instance_name>, where you replace <instance_name> with the desired value.

License

BSD-3-Clause

Author Information

ELAN e.V

About

install prometheus

Install
ansible-galaxy install elan.monitoring_prometheus
GitHub repository
License
bsd-3-clause
Downloads
4.1k
Owner
elan e.V. is a German non-profit organization helping universities and other higher education organizations with all things related to e-learning