We used https://github.com/ansible/ansible/blob/devel/contrib/inventory/spacewalk.py
This uses spacewalk report to produce an inventory file for Ansible – the groups in spacewalk correspond to Ansible groups 1:1. One major shortcoming here is that Spacewalk does not support nested groups like Ansible does, so you have to assign multiple groups to a system in SW. This sounds simple but it gets out of hand rather quickly depending on your scope. How Ansible wants you to do it: [webservers] my-web-server [linuxservers:children] webservers Spacewalk inventory equivalent: [webservers] my-web-server [linuxservers] my-web-server For this reason, we maintain a lot of grouping stuff in the inventory outside of Spacewalk. Instead of using this script as a traditional Ansible Dynamic inventory provider, it now just runs on a cron, appending to an existing inventory that is maintained by hand (in version control of course :)). David Bryant | Cyber DevOps Specialist | BT GS From: [email protected] [mailto:[email protected]] On Behalf Of Guy Matz Sent: Wednesday, May 2, 2018 9:48 AM To: [email protected] Subject: Re: [Spacewalk-list] Dynamic Groups? David Bryant, Yes! Using spacewalk as a means for grouping hosts for ansible was the cause of my question in the first place! Could you elaborate a bit? Thanks a lot!! On Tue, May 1, 2018 at 6:17 PM, <[email protected] <mailto:[email protected]> > wrote: Guy, This really depends on your use case. At first, I grouped by OS major version because Spacewalk primarily handled package management. Later on, I moved to role-based groupings so that Spacewalk could be the dynamic inventory provider for Ansible stuff. David Bryant | Cyber DevOps Specialist | BT GS From: [email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]> ] On Behalf Of Guy Matz Sent: Tuesday, May 1, 2018 4:03 PM To: [email protected] <mailto:[email protected]> Subject: Re: [Spacewalk-list] Dynamic Groups? Thanks for the reply! Maybe I should just ask if anyone knows of a doc on best practices for groups in spacewalk? Or if anyone has any opinions? Thanks again, Guy On Mon, Apr 30, 2018 at 8:38 PM, Waldirio Manhães Pinheiro <[email protected] <mailto:[email protected]> > wrote: Hello Guy Could you explain more *in details* what is your real necessity ? I believe you can *automate* your SW/Internal features in different ways, for example, using - API - space_cmd - spacewalk-api But is not clear to me what is your real necessity just to recommend the best way to you move forward. Have a good one. ______________ Atenciosamente Waldirio msn: [email protected] <mailto:[email protected]> Skype: waldirio Site: www.waldirio.com.br <http://www.waldirio.com.br> Blog: blog.waldirio.com.br <http://blog.waldirio.com.br> LinkedIn: http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646 PGP: www.waldirio.com.br/public.html <http://www.waldirio.com.br/public.html> On Mon, Apr 30, 2018 at 3:41 PM, Guy Matz <[email protected] <mailto:[email protected]> > wrote: Hi! I know I can work with Intersections/Unions of groups, but is there a way to make these groups dynamic? So if, for example if I want a group of prod centos6 servers, I can have a group that is an intersection of "prod" and "centos6", but will that intersection get updated with new servers as I add them? If not, any work-around here? Thanks a lot, Guy _______________________________________________ Spacewalk-list mailing list [email protected] <mailto:[email protected]> https://www.redhat.com/mailman/listinfo/spacewalk-list _______________________________________________ Spacewalk-list mailing list [email protected] <mailto:[email protected]> https://www.redhat.com/mailman/listinfo/spacewalk-list _______________________________________________ Spacewalk-list mailing list [email protected] <mailto:[email protected]> https://www.redhat.com/mailman/listinfo/spacewalk-list
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Spacewalk-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-list
