I have to disagree to an extend.
If you know the objects and do transactions in the proper order it might work but it means you have to define hosts, networks and services first. Then groups containing only these type of objects, and so on. And only once all objects are defined a specific object depends on.
While it may work in theory it will not work this way in real life.
However if you have definded everything after initial install using the API you may have a record of this and you might redo all steps. But it requires you have designed this to work this way before you started the initial policy to begin with.
As much as I like Ansible and idempotent solutions like it this is hardly ever the case.
<< We make miracles happen while you wait. The impossible jobs take just a wee bit longer. >>