Skip to content

Setting variable telegraf_agent_package does not work as expected #150

@NKissler

Description

@NKissler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeded-helpIssues/PR requires help to continue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions