telekom-mms / ansible-collection-icinga

This collection offers an almost complete solution to set up your monitoring with Ansible and Icinga. From setting up the Icinga agent unto automating the deployment of the Icinga director, you can install the necessary tools from a single source.
6 stars 8 forks source link

icinga_plugins role is not compatible to debian #13

Closed vmpr closed 2 years ago

vmpr commented 2 years ago

I just tested the next role from the collection and also that one is not compatible with Debian :(

cheers

beechesII commented 2 years ago

Hi @vmpr , icinga_install_plugins is not defined by default. You should be able to install monitoring-plugins on debian, if you define the variable.

icinga_install_plugins: 
  - monitoring-plugins
vmpr commented 2 years ago

Hi @beechesII thanks for your answer, like I said it will never try to install plugins because of the when conditions with not rhel and major version is smaller than 8 because its debian10 :)

I also had to change that one:

- name: set plugins ownership
  ansible.builtin.file:
    path: "{{ item.path }}"
    owner: "{{ icinga2_user[ansible_os_family] }}"
    group: "{{ icinga2_group[ansible_os_family] }}"
    mode: 0755
  loop: "{{ files_in_plugins_dir.files }}"
  loop_control:
    label: "{{ item.path }}"
  tags:
    - set_ownership

plus set these variables:

    # this paths needs to go into the plugins role
    icinga2_plugins_basedir: /usr/lib/nagios
    icinga2_plugins_pluginsdir: "{{ icinga2_plugins_basedir }}/plugins"
    # icinga user/group for plugins role, they need to fix that
    # i fixed the role code to make it possible :(
    icinga2_user:
      Debian: nagios
      RedHat: icinga
    icinga2_group:
      Debian: nagios
      RedHat: icinga

cheers

beechesII commented 2 years ago

Hi @vmpr ,

I created a branch fix_role_icinga_plugins_for_debian based on your code snippets in this issue. I tested both roles on my debian 11 virtual machine with the following playbook:

---
- hosts: localhost
  gather_facts: true
  collections:
    - t_systems_mms.ansible_collection_icinga
  vars:
    icinga_agent_endpoints:
      - name: "icinga2-master1.localdomain"
        host: "192.154.44.101"
      - name: "icinga2-satellite1.localdomain"
        host: "192.154.44.107"
    icinga_agent_zones:
      - name: "master"
        endpoints:
          - "icinga2-master1.localdomain"
      - name: "satellite"
        endpoints:
          - "icinga2-satellite1.localdomain"
        parent: "master"
  roles:
    - icinga_agent

- hosts: localhost
  collections:
    - t_systems_mms.ansible_collection_icinga
  vars:
    icinga_install_plugins:
      - monitoring-plugins
  roles:
    - icinga_plugins

Could you please checkout changes from branch fix_role_icinga_plugins_for_debian for debian 10?

Thx for reporting this issue :)

Have a nice day.