telekom-mms/ansible-collection-icinga

icinga_agent role is not compatible to debian

Closed this issue · 10 comments

vmpr commented

I just wanted to use your collection/role to install and configure icinga2 agent for my Debian 10 server but the role is not compatible, maybe you could mention that somewhere?

also ansible galaxy links are broken:

icinga_agent role:
Examples on how to use the role can be found here https://github.com/T-Systems-MMS/ansible-collection-icinga/blob/improve_readme/roles/icinga_agent/README.md

Yeah, the compatible platforms are missing from the role. And we'll need to fix the links!

What's the error you're getting when using the role on Debian 10?

vmpr commented

there are some errors, first thing it needs the official icinga apt repo on the system otherwise it installs a crappy old version.
next one is all the owner/group permissions tasks need to be os dependent because Icinga seems to run as user "nagios" in debian10, so it can't find the user "icinga"

TASK [t_systems_mms.ansible_collection_icinga.icinga_agent : create /etc/icinga2/repository.d] ***
fatal: [XXX-live-foo01.live.XXX.io]: FAILED! => {"changed": false, "gid": 0, "group": "root", "mode": "0755", "msg": "chown failed: failed to look up user icinga", "owner": "root", "path": "/etc/icinga2/repository.d", "size": 4096, "state": "directory", "uid": 0}

that's when I stopped looking into it. I'd like to help to fix it but can't do anything until next year. cheers

Hello @vmpr and @rndmh3ro.

Thank you for reporting this issue. We will try to fix this and then we'll come back with a solution.

Hello @vmpr could you try it again with our 1.0.6 release? We've added support for Debian.

vmpr commented

Hi @xFuture603 - thanks for the implementation, looks good so far, but I found another typo in the role:

- name: restart icinga2-agent
  ansible.builtin.service:
    name: icinga2
    enabled: true
    state: started

that doesn't look like a restart handler to me - can you please also fix that?

after more testing I found another problem:

on Debian systems the standard "plugindir" paths differ to redhat servers, its not /usr/lib64/nagios/

        icinga_agent_constants_conf: |
          const PluginDir = "/usr/lib/nagios/plugins"
          const PluginContribDir = "/usr/lib/nagios/plugins"
          const ManubulonPluginDir = "/usr/lib/nagios/plugins"
          const ZoneName = "{{ ansible_hostname }}"
          const NodeName = "{{ ansible_hostname }}"
          const TicketSalt = ""

cheers

Hello @vmpr

Thanks for reporting the bug. I have implemented the change in the 1.0.7 release. Can you test it again?

kind regards

vmpr commented

@xFuture603 I've tested the release and it works, thanks for implementing the constants.conf based on the os.
I'm just wondering why you renamed the handler to start instead of configuring it to actually restart the service? in my opinion, it needs a restart after configuration changes, especially when you change stuff after Icinga was initially installed and is already running. please consider to change that :) cheers

I just tested the role on a fresh machine again and yeah, the handler needs to restart the icinga2 service otherwise the configuration will not be applied. cheers

@vmpr The handler is fixed in the 1.0.8 release. Can you check this so we can close this issue?

Thank you.

vmpr commented

cheers everything works as expected now

Good to hear. So I will close this issue now.