Thanks so much for this: Just 2 questions:
1. where does this snippet go? there are alot of config files, and i want this to filter for all hosts that have agents (all my hosts are in the default group)
2 I am trying to manage the configuration of ossec.conf with ansible's xml task
when i try and edit the file it returns the error:
Error while parsing document: /var/ossec/etc/ossec.conf (Extra content at the end of the document, line 360, column 1 (ossec.conf, line 360))
which is inaccurate because its actually failing because there are multiple roots <ossec_config></ossec_config> which is what the xml parser is really choking on. I've read that wazuh supports multiple xml root statements, and this is fine for running it, but for managing the config with ansible this seems to be a deal breaker.
As a hack i commented out the 1st instance of </ossec_conf> and the 2nd instance of <ossec_conf> as this allowed it to see the file with as having a single root, but I'm wondering if theres any way to do this thats cleaner.