aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tasks/strategy_yaml.yml
Commit message (Collapse)AuthorAgeFilesLines
* Fix pre-commit lint violationsColin Wilk3 days1-2/+2
|
* Add `state` option for removing exportersColin Wilk3 days1-5/+32
|
* fix: prevent lost YAML targets during parallel writesColin Wilk2026-07-211-53/+97
| | | | | | | | | | | | | | | | | | | | The YAML strategy performed a separate read-modify-write operation for every managed host. Because these tasks were delegated to the same Prometheus host, parallel Ansible forks could read the same original file before any fork wrote its update. Each fork then generated YAML containing only its own target. Although the copy module atomically replaced the file, it did not make the full read-modify-write sequence atomic. The last fork to write therefore overwrote targets added by earlier forks. Collect exporter updates from all hosts through hostvars, process them in one run_once operation, and write each distinct target file once. This preserves every target without requiring users to set serial. Add parallel coverage for multiple target files and label groups, and reset the fixtures on every convergence so stale files cannot hide the race.
* refactor: bump and fix pre-commit errorsColin Wilk2026-07-031-14/+14
|
* Add support for YAML strategyMagnus Kühne2026-02-091-0/+71
Introduces a new 'yaml' strategy using Ansible's `from_yaml` to read target files. This allows users to group multiple targets with distinct label sets (e.g., severity or job) within a single file, optimizing Prometheus file-based service discovery. - Refactored task structure into `strategy_*.yml` for consistency. - Extracted shared exporter variable computation. - Implemented label merging where exporter labels override defaults. - Included support for groups and hosts without labels to prevent crashes. PR: (#1) https://github.com/kliwniloc/ansible-role-prometheus-target/pull/1