theforeman / foreman_ansible_inventory

Foreman dynamic inventory script for ansible - Now merged into Ansible itself
GNU General Public License v3.0
70 stars 31 forks source link

Groups in ansible not created for Host Collections? #40

Open viddypiddy opened 7 years ago

viddypiddy commented 7 years ago

I might be doing something wrong, but I can't seem to find any mention of my host collections in the ansible inventory output?

I am using host collections for systems crossing multiple OS versions, which seems to not be able to overlap within one host group. But after running foreman_ansible_inventory I can't see them anywhere.

Is this not implemented or am I doing something weird here.

dLobatog commented 7 years ago

It's not implemented because it'd slow the inventory down quite a bit due to having to make a 2nd API call to retrieve them - https://github.com/theforeman/foreman_ansible_inventory/issues/2 - If you can think of a way to implement them w/o slowing down the inventory in cases that don't need host collections (and thus can work with just 1 API call) - I'd be glad to accept the contribution. Sorry!

agx commented 7 years ago

On Wed, Dec 14, 2016 at 12:53:21AM -0800, Daniel Lobato García wrote:

It's not implemented because it'd slow the inventory down quite a bit due to having to make a 2nd API call to retrieve them - https://github.com/theforeman/foreman_ansible_inventory/issues/2 - If you can think of a way to implement them w/o slowing down the inventory in cases that don't need host collections (and thus can work with just 1 API call) - I'd be glad to accept the contribution. Sorry!

What we could do is add a toggle that would have these things disabled by default and which can be enabled if someone can live with reduced speed. We do s.th. similar for facts.

viddypiddy commented 7 years ago

Right. I feared the functionality might not be in. Thanks for the clarification. In my case I would not mind a slowdown, since I am using the cache quite aggressively. A toggle would probably be the ideal choice to not slow it down by default.

I am not too good at Python, so I can't contribute sadly. Feel free to close the issue if this is something you won't consider implementing.

Thanks!

agx commented 7 years ago

On Thu, Dec 15, 2016 at 07:35:42AM -0800, Marius Eikenes wrote:

Right. I feared the functionality might not be in. Thanks for the clarification. In my case I would not mind a slowdown, since I am using the cache quite aggressively. A toggle would probably be the ideal choice to not slow it down by default.

I am not too good at Python, so I can't contribute sadly. Feel free to close the issue if this is something you won't consider implementing.

I'm not using collections myself so I won't be able to do this soonish but let's keep it open - maybe somebody else cooks up a patch.

missnebun commented 7 years ago

+1 for this ... How you can group servers if you are not using host collection ? I mean taking advantage of the host_vars/ Special when you have multiple applications that they need to be grouped.

chrispoupart commented 7 years ago

+1 as well. The lack of this functionality is keeping us using a local inventory file, which is obviously less than ideal. We also need to group servers in ways other than just Host Groups, Org, or Environment.

dLobatog commented 7 years ago

We are tracking this issue under https://github.com/ansible/ansible/pull/25269 , @clasohm stepped up to fix it 😄 !