Skip to content

install latest version? #681

@antondollmaier

Description

@antondollmaier

Hi folks,

When deploying node_exporter 1.10.2, we set the node_exporter_version variable to latest. According to the spec and prior usage, this works perfectly fine. Until it now doesn't.

The playbook run fails at TASK [prometheus.prometheus._common : Download node_exporter-latest.linux-amd64.tar.gz] when it tries to download https://github.com/prometheus/node_exporter/releases/download/vlatest/node_exporter-latest.linux-amd64.tar.gz.

I took a dive in the history and found 3c5d710. This change removes the previous install.yml and now uses prometheus.prometheus._common.

Now, the URL is passed directly:

- name: Install
  ansible.builtin.include_role:
    name: prometheus.prometheus._common
    tasks_from: install.yml
  vars:
    _common_local_cache_path: "{{ node_exporter_local_cache_path }}"
    _common_binaries: "{{ _node_exporter_binaries }}"
    _common_binary_install_dir: "{{ node_exporter_binary_install_dir }}"
    _common_binary_url: "{{ node_exporter_binary_url }}"
    _common_checksums_url: "{{ node_exporter_checksums_url }}"
    _common_system_group: "{{ node_exporter_system_group }}"
    _common_system_user: "{{ node_exporter_system_user }}"
    _common_config_dir: "{{ node_exporter_config_dir }}"
    _common_binary_unarchive_opts: ['--strip-components=1']
  tags:
    - node_exporter_install

The task to identify the latest version is still present and works (see https://github.com/prometheus-community/ansible/blob/main/roles/node_exporter/tasks/preflight.yml#L51 ), but the updated node_exporter_version fact isn't used anymore. As such, the Binary URL and the other variables are not updated either, so all rely on latest as a literal. The URL was generated from the defaults and isn't updated.

The same happens also for alertmanager, blackbox exporter, and prometheus.

I assume that this behaviour isn't intended.

To resolve I see the following options:

  1. either the documentation is updated to remove the possibility of using latest. Bad, but at least then there's consistency.
  2. or the functionality is restored, so the URLs are updated after the new version has been discovered. This would result in a generated URL after the actual version has been retrieved.

Unfortunately, I'm not an Ansible expert, so I could only assist with the first part.

Let me know what your thoughts are on this.

Best,
Anton

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions