I want to use Ansible to add Icinga2 passive monitoring for my hosts with agent monitoring. I have a single master node and am not using satellites yet.
I’ve had some success in setting up the client side thanks to this answer.
What commands do I need to run on the master node to add in the remote node?
I’m using Ansible so I specifically want to avoid the wizard.
I’ve looked at https://icinga.com/docs/icinga2/snapshot/doc/06-distributed-monitoring/#distributed-monitoring-master-agents and I can’t work out how to add extra hosts in one-by-one. It looks like the zones file on the master node at /etc/icinga2/zones needs to have all the hosts defined at once.
I’d prefer use separate files for each host that I’m managing because my Ansible skills aren’t good enough to be confident around inserting and deleting blocks of config within that file.
Are there any examples of Ansible setups like this?