<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ansible-role-prometheus-target/tasks/main.yml, branch 1.4.0</title>
<subtitle>Ansible role for pushing targets to prometheus instance</subtitle>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/'/>
<entry>
<title>fix: prevent lost YAML targets during parallel writes</title>
<updated>2026-07-21T17:11:08+00:00</updated>
<author>
<name>Colin Wilk</name>
<email>colin@wilk.cx</email>
</author>
<published>2026-07-21T17:10:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/commit/?id=0055971afd5524f0df00fc8d2203a80f828885f7'/>
<id>0055971afd5524f0df00fc8d2203a80f828885f7</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: bump and fix pre-commit errors</title>
<updated>2026-07-03T18:15:09+00:00</updated>
<author>
<name>Colin Wilk</name>
<email>colin@wilk.cx</email>
</author>
<published>2026-07-03T18:15:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/commit/?id=9368443af5c0cdfbadbd54f92814dadce1c4e663'/>
<id>9368443af5c0cdfbadbd54f92814dadce1c4e663</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for YAML strategy</title>
<updated>2026-02-09T16:23:57+00:00</updated>
<author>
<name>Magnus Kühne</name>
<email>73171182+magkue@users.noreply.github.com</email>
</author>
<published>2026-02-09T16:23:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/commit/?id=049689c124a274870b5405ff6816beeba7d94a14'/>
<id>049689c124a274870b5405ff6816beeba7d94a14</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>Add run_once option for handlers</title>
<updated>2023-10-11T13:49:45+00:00</updated>
<author>
<name>Colin Wilk</name>
<email>colin.wilk@tum.de</email>
</author>
<published>2023-10-11T13:34:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/commit/?id=c9c812343831be1bb56965b2aeff41eecdae0a11'/>
<id>c9c812343831be1bb56965b2aeff41eecdae0a11</id>
<content type='text'>
This adds the run_once option for the two handler types (shell and
command). The variables `prometheus_target_handler_command_run_once`
and `prometheus_target_handler_shell_run_once` are introduced to
control this behavior.

For this change a switch from the Ansible Handlers to regular tasks was
necessary to  enforce run_once behavior with delegated hosts. If you
don't rely on handler specific features such as deferring, nothing
changes when using the role.

Signed-off-by: Colin Wilk &lt;colin.wilk@tum.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds the run_once option for the two handler types (shell and
command). The variables `prometheus_target_handler_command_run_once`
and `prometheus_target_handler_shell_run_once` are introduced to
control this behavior.

For this change a switch from the Ansible Handlers to regular tasks was
necessary to  enforce run_once behavior with delegated hosts. If you
don't rely on handler specific features such as deferring, nothing
changes when using the role.

Signed-off-by: Colin Wilk &lt;colin.wilk@tum.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>init</title>
<updated>2023-05-26T17:59:24+00:00</updated>
<author>
<name>Colin Wilk</name>
<email>colin.wilk@tum.de</email>
</author>
<published>2023-05-26T17:59:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.wilk.cx/ansible/ansible-role-prometheus-target.git/commit/?id=9db96602063e6ceb3cb8e819a8e942f28061bb42'/>
<id>9db96602063e6ceb3cb8e819a8e942f28061bb42</id>
<content type='text'>
Signed-off-by: Colin Wilk &lt;colin.wilk@tum.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Colin Wilk &lt;colin.wilk@tum.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
