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

Setting variable telegraf_agent_package does not work as expected #150

Open
NKissler opened this issue Dec 27, 2021 · 2 comments
Open

Setting variable telegraf_agent_package does not work as expected #150

NKissler opened this issue Dec 27, 2021 · 2 comments
Labels
bug Something isn't working needed-help Issues/PR requires help to continue.

Comments

@NKissler
Copy link

Describe the bug
When it comes to setting the variable telegraf_agent_package Debian is behaving differently from any other distro.

The README states:
"telegraf_agent_package: The name of the Telegraf package to install. When telegraf_agent_package_method is set to online or offline, it needs to have the full path of the file. Example: telegraf_agent_package: /tmp/telegraf.rpm. Default: telegraf_agent_package: telegraf."

For method online setting the full path does not work with Debian.
The culprit seems to be in these two lines, where the package path is built from two variables and telegraf_agent_package is expected to be only the package name:
https://github.com/dj-wasabi/ansible-telegraf/blob/master/tasks/Debian.yml#L75
https://github.com/dj-wasabi/ansible-telegraf/blob/master/tasks/Debian.yml#L97

Compare to e.g. RedHat where only one variable is used which expects the full path:
https://github.com/dj-wasabi/ansible-telegraf/blob/master/tasks/RedHat.yml#L30

Installation method/version

  • Github / latest (0.13.2)
  • Ansible Galaxy / Ansible 2.9.13

Targeted hosts
Concerns the following OS(es):

  • Debian

Expected behavior
Set variables
telegraf_agent_package_method: online
telegraf_agent_package: /tmp/telegraf.rpm (full package path)
Rollout works for all distros.

Current behavior
Set variables
telegraf_agent_package_method: online
telegraf_agent_package: /tmp/telegraf.rpm (full package path)
-> Rollout fails for Debian. Rollout works for RedHat etc.

Set variables
telegraf_agent_package_method: online
telegraf_agent_package_path: /tmp
telegraf_agent_package: telegraf.rpm
-> Rollout works for Debian only.

Additional context
Because of this bug the variable telegraf_agent_package cannot be configured to universally work with Debian AND the other distros.
You can work around the problem if you are only every using the role for either Debian OR RedHat/... based systems by setting the variables as stated above under "Current behavior". This however does not apply to our setup where we maintain servers running a mixture of those distros.

@egmont1227
Copy link

egmont1227 commented Jan 24, 2022

@dj-wasabi any news on that? Shall @noris-network provide a MR to fix it?

Might also be connected to #115 and #95

@dj-wasabi
Copy link
Owner

Hi @egmont1227 Sorry for late reply, but I am all open to PR's. I don't have much time lately to work on this role. I hope soon that I am able to spend some time on it again. In the mean time I accept all help. 😄 👍

@dj-wasabi dj-wasabi added bug Something isn't working needed-help Issues/PR requires help to continue. labels Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needed-help Issues/PR requires help to continue.
Projects
None yet
Development

No branches or pull requests

3 participants