Install the latest loki version with ansible.
Have a look at the defaults to see what variables you can set.
You can specify the log retention period by setting the variable loki_retention_deletes
to true
and
loki_retention_period
to the desired retention period.
The role contains a template for a basic config file.
In most cases, however, you would probably want to provide your own config-templates.
You can achieve this by changing the path to the template file in loki_config_template
.
Just add the role to your playbook and specify your template:
- hosts: all
become: true
roles:
- role: elan.monitoring_loki
loki_config_template: 'custom_templates/loki.yml.j2'
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.