diff --git a/roles/prometheus-node-exporter/tasks/main.yml b/roles/prometheus-node-exporter/tasks/main.yml index aba7fd6..6dda7ad 100644 --- a/roles/prometheus-node-exporter/tasks/main.yml +++ b/roles/prometheus-node-exporter/tasks/main.yml @@ -99,6 +99,7 @@ - name: Add the node to the targets set_fact: server_target: "[{{ server_target[0] | combine({'targets': [lan_address]}, list_merge='append_rp') }}]" + when: lan_address not in server_target.0.targets - name: Put the new target list copy: