I’m using the ansible galaxy collection and currently this is my playbook that runs against a group of hosts. (They were added with from a previous task) Is there a better way to run discovery on all hosts, without taking over 6s per host (Currently takes around 30 minutes for all and I still have hosts to add to.) I’ve tried using the bulk option as well (as seen), but it doesn’t look like to work any better, still takes 6s per host.
Any advice would be apprciated.
What you show is not the bulk mode. With the loop statement you run the task once for each host. bulk_size doesn’t make sense in that case.
For the bulk mode you need to replace the host_name attribute (for one single host) with the hosts attribute (which is a list of hosts) and then drop the loop statement. Only then the bulk_size makes sense.
(Disclaimer: I haven’t tried this because I don’t have this ansible collection installed. I just read the docs and am a bit familiar with Ansible. Might be that you need to write the line hosts: "{{ checkmk_hosts }}" a bit differently to just pick their names.)
That is what I initially tried, but the idea behind the item.name is that the hosts have additional attributes and I want to specify only the name and abstract from the others . Example as below :