dj-wasabi / ansible-telegraf

Installing and configuring Telegraf via Ansible for RedHat/Debian/Ubuntu/Windows/Suse.
MIT License
134 stars 116 forks source link

Don't install init script on SUSE/openSUSE systems running systemd #152

Closed jeffmahoney closed 1 year ago

jeffmahoney commented 2 years ago

Describe the bug

The telegraf packages in the open build service have a systemd service file but this role installs an init script unconditionally.

Newer SUSE/openSUSE systems don't require insserv-compat to be installed and installing the init script will fail with:

Unable to enable service telegraf: Synchronizing state of telegraf.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable telegraf
/sbin/insserv: No such file or directory

Installation method/version

ansible 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/jeffm/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.12 (default, Aug 31 2021, 01:23:42) [GCC]

Targetted hosts Concerns the following OS(es):

Expected behavior

The role installs telegraf and enables it without error.

Additional context

I've fixed this locally and will start a PR after submitting this issue to use as a reference.

dj-wasabi commented 2 years ago

Thanks bro, really appreciated! 👍