Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong snmp_exporter binary source path #97

Closed
wants to merge 1 commit into from

Conversation

sebbbastien
Copy link
Contributor

This is a PR to fix #96

Not familiar with contributions and PR, please be indulgent

@sebbbastien sebbbastien changed the title Fix wrong snmp_exporter binary source path fix: wrong snmp_exporter binary source path May 5, 2023
@github-actions github-actions bot added the bugfix label May 5, 2023
@SuperQ
Copy link
Contributor

SuperQ commented May 7, 2023

Hmm, I think there's more to fix than this.

@sebbbastien
Copy link
Contributor Author

Hmm, I think there's more to fix than this.

Do you mean, this error is present on other installations, or, there is more to fix for snmp_exporter install?

To fix the error during snmp_exporter install, the change is enough on my side.

Is it possible to write a molecule test to check this issue?

@gardar
Copy link
Member

gardar commented May 9, 2023

The problem is actually just that the dest from get_url is missing the trailing slash, which makes ansible use a random name rather than the name from the source.

- name: Download snmp_exporter binary to local folder
become: false
ansible.builtin.get_url:
url: "{{ snmp_exporter_binary_url }}"
dest: "/tmp"
checksum: "sha256:{{ snmp_exporter_checksum }}"
mode: 0644
register: _download_binary

Should be either

  ansible.builtin.get_url:
    url: "{{ snmp_exporter_binary_url }}"
-    dest: "/tmp"
+    dest: "/tmp/"
    checksum: "sha256:{{ snmp_exporter_checksum }}"
    mode: 0644
  register: _download_binary

or to be consistent with the other roles:

  ansible.builtin.get_url:
    url: "{{ snmp_exporter_binary_url }}"
-    dest: "/tmp"
+    dest: "/tmp/snmp_exporter-{{ snmp_exporter_version }}.linux-{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.tar.gz"
    checksum: "sha256:{{ snmp_exporter_checksum }}"
    mode: 0644
  register: _download_binary

@SuperQ
Copy link
Contributor

SuperQ commented Aug 22, 2023

This should be fixed by #204.

@SuperQ
Copy link
Contributor

SuperQ commented Aug 25, 2023

Fixed in #204

@SuperQ SuperQ closed this Aug 25, 2023
@github-actions
Copy link
Contributor

Docs Build 📝

This PR is closed and any previously published docsite has been unpublished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to install snmp_node_exporter
3 participants