promtail
ansible-role-promtail
Example Playbook
- hosts: all
roles:
- grokon.promtail
vars:
promtail__loki_server_domain: my_loki_instance
promtail__scrape_configs:
- job_name: syslog
static_configs:
- targets:
- localhost
labels:
job: syslog
host: "{{ ansible_host }}"
__path__: /var/log/syslog
An Ansible Role that installs promtail on Debian
Table of content
- Default Variables
- promtail__config_clients
- promtail__config_dir
- promtail__config_file
- promtail__config_file_sd_dir
- promtail__config_positions
- promtail__config_server
- promtail__install
- promtail__log_level
- promtail__loki_server_url
- promtail__path
- promtail__scrape_configs
- promtail__target_config
- promtail__tmp_dir
- promtail__url
- promtail__version
- Discovered Tags
- Open Tasks
- Dependencies
- License
- Author
Default Variables
promtail__config_clients
Promtail clients config
Default value
promtail__config_clients:
- url: '{{ promtail__loki_server_url }}/loki/api/v1/push'
promtail__config_dir
Promtail configurations directory
Default value
promtail__config_dir: /etc/promtail
promtail__config_file
Promtail config file path
Default value
promtail__config_file: '{{ promtail__config_dir }}/config.yml'
promtail__config_file_sd_dir
Promtail file_sd directory
Default value
promtail__config_file_sd_dir: '{{ promtail__config_dir }}/file_sd'
promtail__config_positions
Promtail positions config
Default value
promtail__config_positions:
filename: '{{ promtail__config_dir }}/positions.yaml'
promtail__config_server
Promtail server config, listen on - for metrics
Default value
promtail__config_server:
http_listen_port: 9080
promtail__install
Weather of not to install promtail Set to false if it's already installed and wanted to remove it
Default value
promtail__install: true
promtail__log_level
Promtail log level. One of: debug, info, warn, error
Default value
promtail__log_level: warn
promtail__loki_server_url
Promtail loki server url
Default value
promtail__loki_server_url: http://localhost:3100
promtail__path
Default path for promtail
Default value
promtail__path: /usr/local/bin/promtail
promtail__scrape_configs
Promtail scrape configurations
Default value
promtail__scrape_configs: []
Example usage
Example:
promtail__scrape_configs:
- job_name: syslog
static_configs:
- targets:
- localhost
labels:
job: syslog
host: "{{ ansible_host }}"
__path__: /var/log/syslog
promtail__target_config
Default value
promtail__target_config: {}
promtail__tmp_dir
TMP directory for download promtail
Default value
promtail__tmp_dir: /tmp
promtail__url
Promtail target config
Default value
promtail__url: https://github.com/grafana/loki/releases/download/v{{ promtail__version
}}/promtail-linux-amd64.zip
Example usage
promtail_target_config:
sync_period: "10s"
promtail__version
Default to latest version, pin version example 2.6.1
Default value
promtail__version: latest
Discovered Tags
promtail_configure
promtail_install
promtail_run
Open Tasks
- (improvement): Add variables for logs
Dependencies
None.
License
MIT
Author
grokon