Skip to content

Commit

Permalink
fix(process_exporter): skip install when there's nothing to do
Browse files Browse the repository at this point in the history
Just like in `roles/node_exporter/tasks/main.yml`: the install tasks can
be skipped conditionally when process_exporter is already installed and
reports the same version as the expected one

Signed-off-by: François HORTA <[email protected]>
  • Loading branch information
Frazew committed Sep 30, 2024
1 parent 4e881c6 commit 7b7b51b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roles/process_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
become: true
tags:
- process_exporter_install
when:
( not __process_exporter_is_installed.stat.exists ) or
( (__process_exporter_current_version_output.stderr_lines | length > 0)
and (__process_exporter_current_version_output.stderr_lines[0].split(" ")[2] != process_exporter_version) ) or
( (__process_exporter_current_version_output.stdout_lines | length > 0)
and (__process_exporter_current_version_output.stdout_lines[0].split(" ")[2] != process_exporter_version) ) or
( process_exporter_binary_local_dir | length > 0 )
tags:
- process_exporter_install

Expand Down

0 comments on commit 7b7b51b

Please sign in to comment.