foreman-ansible-modules
foreman-ansible-modules copied to clipboard
Add and Remove Hosts from Host Collection
SUMMARY
Expand a module or add a new module which allows hosts to be added/removed from host collections
ISSUE TYPE
- Feature Idea
This is a valid feature request. We have host and host_collection modules, and either should be able to manage host <-> host_collection associations
I'd love to have this functionality. I'm looking to use host collections as my data source for ansible groups. I'm aware that I could do this using host groups, but I prefer to use host collections because host groups have other configuration associated with them, such as OS version, PXE templates, etc.
I would also like to have this functionality.
As a stopgap, I hacked together a module that has this functionality and put it in https://github.com/kkeane/theforeman-addon
It is not code I'm most proud of, and not suitable as a contribution to the collection, but serves the purpose for me, and hopefully for others until this functionality is added to the collection itself.
I will try to pick this up after Tech Exchange.
I would also like to have this functionality.
As a stopgap, I hacked together a module that has this functionality and put it in https://github.com/kkeane/theforeman-addon
It is not code I'm most proud of, and not suitable as a contribution to the collection, but serves the purpose for me, and hopefully for others until this functionality is added to the collection itself.
Any chance you will be submitting it to this collection? Since nobody else seems to be working on this.
@gardar That had been my original plan, but I found that it is not trivial to fit into the collection. The collection has a specific, and very complex, way of mapping attributes between Ansible and the API, and I'm plain not experienced enough with it to make it work
If you want to take a stab at it, feel free - my code is open source, after all. As usual, just keep it open source, give me credit, yadayada. You may need to rewrite it from scratch to fit into the collection, if it can be done at all. I suspect that the issue is deeper, that the architecture of the collection itself may not fit for host collections (and a few of the other missing pieces that I also put into my own collection). That's probably why nobody else worked on it despite a clear need from the community.
@kkeane understood, unfortunately I'm not familiar enough with the collection myself to be able to shed some light into what needs to be done, I'm assuming you've seen these docs: https://theforeman.org/plugins/foreman-ansible-modules/ But perhaps @evgeni or @parmstro can give pointers?
With that being said, could you package your module as a ansible collection? That way it would be easy to install it as a dependency.
I'm trying to revive this dead issue. :-) Does anyone have time to look into it? Unfortunately I'm not experienced enough at Python to contribute.
Hi,
we are using the Red Hat Satellite and looking forward to being able to add and remove hosts on host collections using theforeman.foreman.host_collection module or a new one. I think, the host module would not be the proper one, when the users are not using it to manage their hosts.
@evgeni @parthaa @mdellweg what do you think?