How do I add a ServiceSet via Ansible?

Hi,

I’m trying to setup monitoring of a great number of servers with Icinga, and I want to configure stuff via Ansible because we already use that to configure the machines.

I can create hosts, hostgroups, and service templates, but I need to assign a ServiceSet to those hostgroups and I can’t figure out how to actually add services to the set.

I’m using the T_SYSTEMS_MMS collection, and I’m sure I must be missing something small, I just can’t find out what.

When creating the service you need to tell it which set it belongs to :slight_smile: t_systems_mms.icinga_director.icinga_service module – Manage services in Icinga2 — Ansible Documentation

1 Like

Ah, thanks. A colleague said we needed to use ServiceTemplates for that, not Services. Using a Service and tying it to a ServiceSet makes sense.

After a fight with defining a Service (I kept getting the vague error “Error: local variable ‘param_service_type’ referenced before assignment”) I seem to be finally on track to defining the entire monitoring stuff in Ansible.