# cobbler query script

**URL:** <https://forum.ansible.com/t/cobbler-query-script/11819>\
**Category:** Ansible Project\
**Created:** [August 21, 2012, 11:57pm UTC](https://forum.ansible.com/t/cobbler-query-script/11819 "2012-08-21T23:57:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jim\_Richardson](https://forum.ansible.com/u/Jim_Richardson)\
**Post date:** [August 21, 2012, 11:57pm UTC](https://forum.ansible.com/t/cobbler-query-script/11819/1 "2012-08-21T23:57:32Z")

</div>

I wrote a cobbler\_query.py script a while back to pull some of this  
info out of a remote cobbler server. Might find it useful or perhaps  
at least a bad example 🙂

[https://github.com/weaselkeeper/cobbler\_query.git](https://github.com/weaselkeeper/cobbler_query.git)

GPL2 so the usual 'take what you want' rules apply.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 22, 2012, 12:22am UTC](https://forum.ansible.com/t/cobbler-query-script/11819/2 "2012-08-22T00:22:50Z")

</div>

Nice. I'm sure there are multiple ways to do it -- my memory of  
Cobbler's API is actually not that great now, as I've intentionally  
forgotten a fair amount of it. I figure even with the same kind of  
datastore and information people are going to want to extract and  
slice it in different ways -- code generating the inventory file vs  
using an inventory script is fair game too.

(Re: [https://github.com/ansible/ansible-plugins/blob/master/inventory/cobbler.py](https://github.com/ansible/ansible-plugins/blob/master/inventory/cobbler.py)  
)
