ansible-collection-icinga icon indicating copy to clipboard operation
ansible-collection-icinga copied to clipboard

Full example of ha cluster deployment

Open fl0wx opened this issue 1 year ago • 6 comments

Hey ho, is there any example of a full ha cluster deployment with 2 master instances (including icinga2, icingaweb2, icingadb)? Or can you provide one? :)

thanks and regards fl0wx

fl0wx avatar Dec 20 '23 13:12 fl0wx

There's no official documentation (yet), but you could have a look at my homelab setup which provisions exactly this, using the collection.

One thing that isn't HA even after using the linked playbook is syncing file-based configuration of Icinga Web from one master instance to another. For this, you'd need to jump through quite some more hoops, unfortunately, which is why it's out of the scope of this collection.

mocdaniel avatar Dec 20 '23 14:12 mocdaniel

thanks a lot :) ill take a look into this :)

fl0wx avatar Dec 20 '23 14:12 fl0wx

Thanks a lot, I'm also looking for the same example for HA cluster with 2 masters . My issue that I don't get the icinga2 service started and I have the following error when I run : icinga2 daemon -C

[2023-12-21 04:42:18 -0500] critical/config: Error: Endpoint object for 'icinga-primary-1' is missing.
Location: in /etc/icinga2/features-enabled/api.conf: 1:0-1:23
/etc/icinga2/features-enabled/api.conf(1): object ApiListener "api" {
                                           ^^^^^^^^^^^^^^^^^^^^^^^^
/etc/icinga2/features-enabled/api.conf(2):   ticket_salt = TicketSalt
/etc/icinga2/features-enabled/api.conf(3):   accept_config = false
[2023-12-21 04:42:18 -0500] critical/config: 1 error

My config is like the following

icinga2_features:
  - name: api
    ca_host: none  
    endpoints:
      - name: icinga-primary-1.{{ env }}.local
        host: icinga-primary-1.{{ env }}.local
      - name: icinga-primary-2.{{ env }}.local
        host: icinga-primary-2.{{ env }}.local
    zones:
      - name: "master"
        endpoints:
          - icinga-primary-1.{{ env }}.local
          - icinga-primary-2.{{ env }}.local
          
icinga2_objects:
  icinga-primary-1.{{ env }}.local:
    - name: icingaweb
      type: ApiUser
      file: local.d/apiusers.conf
      password: "***********"
      permissions: ['*']
  
  icinga-primary-2.{{ env }}.local:
    - name: icingaweb
      type: ApiUser
      file: local.d/apiusers.conf
      password: "***********"
      permissions: ['*']

Not sure but did we need to create also Objects type Zone and Endpoints also or they are not needed. I tried them but also nothing was changed Any idea ?

Thanks Achraf

aneffati avatar Dec 21 '23 10:12 aneffati

Can you put the following in quotes:

icinga2_features:
  - name: api
    ca_host: none  
    endpoints:
      - name: "icinga-primary-1.{{ env }}.local"
        host: "icinga-primary-1.{{ env }}.local"
      - name: "icinga-primary-2.{{ env }}.local"
        host: "icinga-primary-2.{{ env }}.local"
    zones:
      - name: "master"
        endpoints:
          - "icinga-primary-1.{{ env }}.local"
          - "icinga-primary-2.{{ env }}.local"

mkayontour avatar Dec 21 '23 10:12 mkayontour

I followed the same config example provided mocdaniel and also I tried with quotes but I'm still getting the same issue.

aneffati avatar Dec 21 '23 11:12 aneffati

Ok, can you post the zones.conf, what is the result. Please post the following files zones.conf and constants.conf. If available redact secrets before posting.

mkayontour avatar Dec 22 '23 06:12 mkayontour