prometheus-community / ansible

Ansible Collection for Prometheus
https://prometheus-community.github.io/ansible/
Apache License 2.0
326 stars 114 forks source link

Wrong binary is uploaded when deploying to multiple architectures #365

Open mjaschen opened 1 month ago

mjaschen commented 1 month ago

The wrong nginx-prometheus-exporter binary is installed with the nginx exporter role when the target servers run under multiple processor architectures.

sample from playbook:

roles:
  - prometheus.prometheus.nginx_exporter

What happens if different target processor archictectures are involved?

The role downloads the archives for each architecture (nginx-prometheus-exporter_1.1.0_linux_amd64.tar.gz, nginx-prometheus-exporter_1.1.0_linux_arm64.tar.gz etc.) and extracts them – but to the same target file (/tmp/nginx-prometheus-exporter).

The upload task picks the target file and uploads it to all servers. This means that all server get the same binary.

A possible fix could look like this:

gitperr commented 1 month ago

It also might make sense to download the file on the target machine then, because we should be able to find the arch with ansible facts.

gardar commented 1 month ago

My suggestion for now would be to group the architectures and then have different tasks in the playbook targeting the different groups.

gitperr commented 1 month ago

Yep, this is a problem that can be solved by maintaining your inventory in a peculiar way. ☝️