https://github.com/dodevops/ansible-loki-callback
An Ansible callback plugin that logs to a loki instance
https://github.com/dodevops/ansible-loki-callback
ansible ansible-callback logging loki
Last synced: about 1 month ago
JSON representation
An Ansible callback plugin that logs to a loki instance
- Host: GitHub
- URL: https://github.com/dodevops/ansible-loki-callback
- Owner: dodevops
- License: mit
- Created: 2024-06-14T12:52:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T15:31:04.000Z (almost 2 years ago)
- Last Synced: 2025-03-11T16:23:01.288Z (over 1 year ago)
- Topics: ansible, ansible-callback, logging, loki
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-loki-callback: An Ansible callback plugin that logs to a loki instance
## Requirements
* Python3
* Ansible
## Installation
Download or clone the repository and install the requirements:
pip install -r requirements.txt
## Usage
Use the following environment variables to configure the plugin:
* LOKI_URL: URL to the Loki Push API endpoint (https://loki.example.com/api/v1/push)
* LOKI_USERNAME: Username to authenticate at loki (optional)
* LOKI_PASSWORD: Password to authenticate at loki (optional)
* LOKI_DEFAULT_TAGS: A comma separated list of key:value pairs used for every log line (optional)
* LOKI_ORG_ID: Loki organization id (optional)
Then set `ANSIBLE_CALLBACK_PLUGINS` to the path where you downloaded or cloned the repository to.
## Testing
The example directory contains a test playbook that can be used to test the callback plugin. Run it using
ANSIBLE_CALLBACK_PLUGINS="${PWD}" ansible-playbook -i example/inventory.yaml example/playbook.yaml -vvvvvv 2>/dev/null