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
node_exporter role errors out while templating #342
Comments
What distro are you on? |
I am using Arch Linux with |
Is that the target system or your control host? |
This is the control host, the target system is a debian bookworm server. |
Hmm, debian bookworm should also definitely work. Does the ansible/roles/node_exporter/tasks/preflight.yml Lines 19 to 21 in 196bd2f
task run on that host? |
Yes it also works on the other 4 bookworm hosts that are part of the playbook.
Yes that is run but gives an empty result as shown above (output from the other hosts stripped):
This seems to be a bug in the builtin module tho 🤔 When I specify
|
Interesting, I wonder if it's attempting to use the wrong package manager when it's set to As a workaround, perhaps you could enforce the apt manager with module_defaults in your playbook |
I have now opened an upstream bug to see whats causing this behaviour for the host in question 👍🏻 |
They have now implemented something to allow for this to work properly (see ansible/ansible#83143 (comment)): - ansible.builtin.package_facts:
manager: "{{ ansible_facts.pkg_mgr }}" As soon as this is rolled out it could be used here aswell 😊 Are you happy with the way they "fixed" the issue? I think the default is still broken 😆 |
Oh that sounds like a mess, I thought the |
Feel free to comment there, I think it could be either made the default or something like |
Click to see full error (with
-vvv
enabled):I think this is due to the usage of
ansible_facts.packages.systemd
here:ansible/roles/node_exporter/templates/node_exporter.service.j2
Lines 63 to 66 in a3aaf70
That is due to the fact that the packages fact for this host are empty:
So do you know how this edgecase could occur and how it could be fixed?
The text was updated successfully, but these errors were encountered: