Skip to content

Commit

Permalink
feat: add promtail_extra_args variable to allow configuring the servi…
Browse files Browse the repository at this point in the history
…ce arguments (#207)

add promtail_extra_args
  • Loading branch information
sfhl authored Apr 8, 2024
1 parent a62c327 commit 772df61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
| `promtail_version` | "2.9.4" | promtail package version. Also accepts *latest* as parameter. |
| `promtail_custom_checksum` | "" | Custom checksum for custom build promtail binaries |
| `promtail_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes the path where zip archive of promtail is stored on host on which ansible is ran. |
| `promtail_extra_args` | [] | Allows to set extra arguments to the binary within the systemd service file. |
| `promtail_config_dir` | /etc/promtail | Directory for storing promtail configuration file |
| `promtail_config_expand_env` | "false" | value of promtail [-config.expand-env](https://grafana.com/docs/loki/latest/clients/promtail/configuration/#use-environment-variables-in-the-configuration) option |
| `promtail_config_file_sd_dir` | "{{ promtail_config_dir }}/file_sd" | Default directory for `file_sd` discovery |
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ promtail_user_additional_groups: "adm"
promtail_systemd_service_template_file: service.j2
promtail_systemd_service: promtail

promtail_extra_args: []

promtail_binary_local_dir: ""
promtail_binary_propagate: False

Expand Down
2 changes: 1 addition & 1 deletion templates/service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RestartSec=5
TimeoutSec=5
User={{ promtail_system_user }}
Group={{ promtail_system_group }}
ExecStart=/usr/local/bin/promtail -config.file={{ promtail_config_file }} -log.level={{ promtail_log_level }} -config.expand-env={{ promtail_config_expand_env | lower }}
ExecStart=/usr/local/bin/promtail -config.file={{ promtail_config_file }} -log.level={{ promtail_log_level }} -config.expand-env={{ promtail_config_expand_env | lower }} {{ promtail_extra_args | join(' ') }}

[Install]
WantedBy=multi-user.target

0 comments on commit 772df61

Please sign in to comment.