On Solaris Ansible's setup
module does not gather information about installed zones. How to extend the setup
module to gather the output of zoneadm list -iv
?
create a script named /etc/ansible/facts.d/zoneadm.fact
and gather whatever information you need there. This can be whatever you want (bash/python/etc).
When you are done, echo
it to stdout as json format.
Deploy that script via ansible, make it executable
Gather facts and notice that the new facts are present under ansible_local.zoneadm
More infos can be found here