Coder Social home page Coder Social logo

telekom-mms / ansible-collection-icinga Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 8.0 262 KB

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.

Jinja 71.39% Shell 28.61%
ansible ansible-collection ansible-modules ansible-roles hacktoberfest icinga-agent icinga2 monitoring

ansible-collection-icinga's People

Contributors

2fraennk avatar beechesii avatar benjaminboehm avatar kam193 avatar lansfojo avatar neubi4 avatar renovate-bot avatar renovate[bot] avatar rndmh3ro avatar schurzi avatar sjedlick avatar xfuture603 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-collection-icinga's Issues

Icinga master does not recognize ticket created on agent

In the icinga_agent role during agent registration, there are a critical series of steps that create the agent certificate and send a pki request to the master:

    - name: generate ticket and save it as a variable
      ansible.builtin.shell: /usr/sbin/icinga2 pki ticket --cn {{ ansible_hostname }} --salt {{ icinga_agent_salt }}
      environment:
        LD_LIBRARY_PATH: "/usr/lib64"
      register: ticket

    - name: create certificate
      ansible.builtin.command: "/usr/sbin/icinga2 pki new-cert --cn {{ ansible_hostname }} --key /var/lib/icinga2/certs/{{ ansible_hostname }}.key --cert /var/lib/icinga2/certs/{{ ansible_hostname }}.crt"
      args:
        creates: "/var/lib/icinga2/certs/{{ ansible_hostname }}.crt"

    - name: save the icinga master's certificate to the host
      ansible.builtin.command: "/usr/sbin/icinga2 pki save-cert --key /var/lib/icinga2/certs/{{ ansible_hostname }}.key --cert /var/lib/icinga2/certs/{{ ansible_hostname }}.crt --trustedcert /var/lib/icinga2/certs/trusted-master.crt --host {{ icinga_agent_ca_host }}"
      args:
        creates: "/var/lib/icinga2/certs/trusted-master.crt"

    - name: generate ticket and save it as a variable
      ansible.builtin.command: "/usr/sbin/icinga2 pki ticket --cn {{ ansible_hostname }} --salt {{ icinga_agent_salt }}"
      register: ticket
      args:
        creates: "/var/lib/icinga2/certs/ca.crt"

    - name: send a pki request to the icinga master
      ansible.builtin.command: "/usr/sbin/icinga2 pki request --host {{ icinga_agent_ca_host }} --port {{ icinga_agent_ca_host_icinga_port }} --ticket {{ ticket.stdout }} --key /var/lib/icinga2/certs/{{ ansible_hostname }}.key --cert /var/lib/icinga2/certs/{{ ansible_hostname }}.crt --trustedcert /var/lib/icinga2/certs/trusted-master.crt --ca /var/lib/icinga2/certs/ca.crt"
      args:
        creates: "/var/lib/icinga2/certs/ca.crt"
      notify:
        - restart icinga2-agent

In my testing, it appears that the "generate ticket and save it as a variable" step (which is repeated twice for unknown reasons) generates a ticket that only the agent knows about. Thus, in the final step, when the agent sends a pki request to the icinga master, the request is rejected due to an unknown ticket:

critical/cli: !!! Invalid ticket for CN 'icinga-agent'.

When I removed the ticket generation from the above steps, the pki request registered properly with the Icinga master and I was able to subsequently approve it.

My question is, what is the intended purpose of the ticket generation? Are these tasks assumed to be ran on the master instead of the agent?

Thanks for maintaining such a useful library! Cheers!

icinga_agent role is not compatible to debian

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

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

ansible-galaxy
galaxy.yml
requirements.yml
  • telekom_mms.icinga_director 2.1.0
github-actions
.github/workflows/CI.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-python v5@82c7e631bb3cdc910f68e0081d67478d79c6982d
  • ansible-community/ansible-test-gh-action v1.15.0@7d847f97e7c69bb18e1cd2b72756ddeaed060430
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • ansible/ansible-lint-action v6.17.0@cad5176ea6f24a38f909d688bd467ec8d942d7e1
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-python v5@82c7e631bb3cdc910f68e0081d67478d79c6982d
  • ghcr.io/telekom-mms/icinga2 director-1.8.1@sha256:bf9205d41607f1641146e870644af0529338d06a9b360737bdf56a3f951cc28b
  • ubuntu 22.04
.github/workflows/galaxy.yml
  • telekom-mms/.github main
.github/workflows/release.yml
  • telekom-mms/.github main
pip_requirements
requirements.txt

  • Check this box to trigger a request for Renovate to run again on this repository

Molecule Tests for role icinga_agent

Actually we implemented molecule tests only for centos7.

We should implement also support & tests for:

  • ubuntu 20.04
  • debian 11 - bullseye
  • rocky linux 8

icinga_plugins role is not compatible to debian

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

  • at the moment the role installs nothing on debian10 because of this when condition:
- name: install icinga and nagios plugins
  ansible.builtin.package:
    name: "{{ item }}"
    state: present
  loop: "{{ icinga_install_plugins }}"
  when:
    - icinga_install_plugins is defined
    - icinga_install_plugins | length > 0
    - ansible_facts.distribution != "RedHat" and ansible_facts.distribution_major_version|int is version('8', '<')

there will be also the problem that package names between RedHat and Debian are different, like:

  • monitoring-plugins in Debian
  • nagios-plugins-all in RedHat

cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.