Closed przemkalit closed 1 month ago
@ivarmu I understand that if the hosts are static they will be exported with smart inventory, but what if we don't want the hosts, because the source inventory with static hosts will be stored in the other place? We should be able to export smart inventory without duplicating hosts etc. I've added the condition for other object like groups just for the sake of keeping the idea, I can remove it.
If I'm not mistaken, your new code does not make sense. You're adding a block but it only holds one task.
I think what you're trying to do is just adding a conditional to those tasks and not add a block.
when: <whatever it's there before> and not skip_inventory_hosts
Oh yes, your totally right, I will change it. Thanks.
@ivarmu I understand that if the hosts are static they will be exported with smart inventory, but what if we don't want the hosts, because the source inventory with static hosts will be stored in the other place? We should be able to export smart inventory without duplicating hosts etc. I've added the condition for other object like groups just for the sake of keeping the idea, I can remove it.
Makes sense. This allows to export only the inventory object itself 👍
What does this PR do?
I've noticed that currently, exporting an inventory includes everything related to it, but sometimes this isn't necessary — for example, when exporting the smart inventory without hosts. That's why I'm proposing this change. Default behaviour stay the same.
How should this be tested?
Cosmetic change, won't need a tests.
Is there a relevant Issue open for this?
N/A
Other Relevant info, PRs, etc
N/A