Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

node_exporter can not be updated when node_exporter_binary_local_dir is set #160

Closed
appliedprivacy opened this issue Jun 16, 2020 · 2 comments · Fixed by #162
Closed

node_exporter can not be updated when node_exporter_binary_local_dir is set #160

appliedprivacy opened this issue Jun 16, 2020 · 2 comments · Fixed by #162
Labels
bug Something isn't working

Comments

@appliedprivacy
Copy link
Contributor

What happened?

After changing

node_exporter_binary_local_dir: node_exporter-1.0.0.linux-amd64

to

node_exporter_binary_local_dir: node_exporter-1.0.1.linux-amd64

I somewhat expected the role to copy the new version to the servers,
but install.yml is ignored after the first playbook run and the version on the servers is not updated.

Moving the task "propagate locally distributed node_exporter binary" from install.yml to main.yml right after the install.yml import would solve this.

How to reproduce it (as minimally and precisely as possible):
run this playbook:

- hosts: server
  roles:
    - ansible-node-exporter
  vars:
    node_exporter_binary_local_dir: /home/user/prometheus_bin/node_exporter-1.0.0.linux-amd64

then run this playbook:

- hosts: server
  roles:
    - ansible-node-exporter
  vars:
    node_exporter_binary_local_dir: /home/user/prometheus_bin/node_exporter-1.0.1.linux-amd64

Environment

  • Role version:

0.21.0

  • Ansible playbook execution Logs:

Task is skipped on second run since the node_exporter file exists on the server already:

TASK [ansible-node-exporter : Propagate node_exporter binaries] ********************************************************************************************
skipping: [server]
@appliedprivacy appliedprivacy added the bug Something isn't working label Jun 16, 2020
@appliedprivacy appliedprivacy changed the title install.yaml is ignored on successive playbook runs when node_exporter_binary_local_dir is set node_exporter can not be updated when node_exporter_binary_local_dir is set Jun 16, 2020
@paulfantom
Copy link
Member

I think adding or (node_exporter_binary_local_dir != "") to the list of conditions in https://github.com/cloudalchemy/ansible-node-exporter/blob/master/tasks/main.yml#L10 should solve the issue.

Could you create a PR?

appliedprivacy added a commit to appliedprivacy/ansible-node-exporter that referenced this issue Jun 17, 2020
@appliedprivacy
Copy link
Contributor Author

thanks for proposing this solution, I tested it and it does what it should do

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants