diff --git a/tasks/main.yml b/tasks/main.yml index ade82e7f..57399547 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,8 +16,12 @@ - node_exporter_configure - node_exporter_run +- command: "/usr/local/bin/node_exporter --version &>/dev/stdout|grep 'version {{ node_exporter_version}}'|awk '{print $3}'" + register: node_exporter_current_version + - import_tasks: install.yml become: true + when: node_exporter_current_version != node_exporter_version tags: - node_exporter_install