Vincent,

You are incorrect, the default behavior is in fact the same as --list.

I'd probably recommend debugging the example inventory script or you may
have an issue with their being no systems the last time the cache of the
inventory was written, which is in cobbler.ini as 900 seconds.




On Wed, Jan 22, 2014 at 10:26 AM, Vincent Van der Kussen <
vincent.vanderkus...@gmail.com> wrote:

> Hi Joost,
>
> I think you might need to add --list as an argument to the script if
> you run it "stand alone".
>
> If you want to use it with ansible or ansible-playbook you can run it
> with -i cobbler.py ( example : ansible-playbook -i cobbler.py
> <playbook> ).
>
> I have no cobbler setup to test this, so I might be wrong.
>
> Vincent
>
> On Wed, Jan 22, 2014 at 3:27 PM, Joost Ringoot <jring...@gmail.com> wrote:
> > Hello,
> >
> > I wanted to give "This script" (from
> >
> http://docs.ansible.com/intro_dynamic_inventory.html#example-the-cobbler-external-inventory-script
> )
> > a try to do the dynamic inventory.
> >
> > Benno helped me in irc to get rid of some errors, due to not having a
> > cobbler.ini in the same directory.
> > An example file can be found in
> /opt/ansible/plugins/inventory/cobbler.ini
> > or in git
> > It would be nice to include that in the manual, for newbies like me
> >
> > Now I have currently 6 hosts in cobbler, but the script seems not aware
> of
> > it, see output below:
> >
> > [root@geppetto ansible]# cobbler system list
> >    metop-20.oma.be
> >    metop-28.oma.be
> >    zotac-09
> >    zotac-24.oma.be
> >    zotac-29
> >    zotac-36
> > [root@geppetto ansible]#  ./cobbler.py
> > {}
> > [root@geppetto ansible]#
> >  [root@geppetto ansible]# cobbler --version
> > Cobbler 2.4.0
> >   source: ?, ?
> >   build time: Thu Jun 20 06:07:51 2013
> > [root@geppetto ansible]#
> >
> > Any ideas?
> > Would it make sense if I upload the output of
> > [root@geppetto ansible]# python -mtrace --trace ./cobbler.py >
> > cobbler.py.debuglog
> >
> > here? It is big!:
> > [root@geppetto ansible]# ls -lah cobbler.py.debuglog
> > -rw-r--r--. 1 root root 3.4M Jan 21 15:01 cobbler.py.debuglog
> > [root@geppetto ansible]# wc -l cobbler.py.debuglog
> > 76780 cobbler.py.debuglog
> > [root@geppetto ansible]#
> >
> >
> >
> > Thanks,
> >
> > Joost
> >
> > BTW:
> > A little note on selinux, since that is often the culprit: I have it
> running
> > currently in permissive mode.
> > I grepped /var/log/audit/audit.log for ansible: nothing found.
> > What I found on cobbler I poured into a policy and applied it and I tried
> > again:
> >
> >
> > [root@geppetto ansible]# grep ansible /var/log/audit/audit.log
> > [root@geppetto ansible]#
> > [root@geppetto ansible]# grep cobbler /var/log/audit/audit.log
> > type=AVC msg=audit(1390309171.088:106152): avc:  denied  { write } for
> > pid=27878 comm="httpd" name="webui_sessions" dev=dm-0 ino=17958021
> > scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=dir
> > type=AVC msg=audit(1390309171.088:106152): avc:  denied  { add_name } for
> > pid=27878 comm="httpd" name="sessionid5f93d6b7217e5248218a9c705f0769cf"
> > scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=dir
> > type=AVC msg=audit(1390309171.088:106152): avc:  denied  { create } for
> > pid=27878 comm="httpd" name="sessionid5f93d6b7217e5248218a9c705f0769cf"
> > scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=file
> > type=AVC msg=audit(1390309171.088:106152): avc:  denied  { write } for
> > pid=27878 comm="httpd" name="sessionid5f93d6b7217e5248218a9c705f0769cf"
> > dev=dm-0 ino=17958488 scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=file
> > type=AVC msg=audit(1390309171.089:106153): avc:  denied  { remove_name }
> for
> > pid=27878 comm="httpd"
> > name="sessionid5f93d6b7217e5248218a9c705f0769cf_out_Ud8hJk" dev=dm-0
> > ino=17958538 scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=dir
> > type=AVC msg=audit(1390309171.089:106153): avc:  denied  { rename } for
> > pid=27878 comm="httpd"
> > name="sessionid5f93d6b7217e5248218a9c705f0769cf_out_Ud8hJk" dev=dm-0
> > ino=17958538 scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=file
> > type=AVC msg=audit(1390309171.089:106153): avc:  denied  { unlink } for
> > pid=27878 comm="httpd" name="sessionid5f93d6b7217e5248218a9c705f0769cf"
> > dev=dm-0 ino=17958488 scontext=system_u:system_r:httpd_t:s0
> > tcontext=system_u:object_r:cobbler_var_lib_t:s0 tclass=file
> > [root@geppetto ansible]#
> >
> > [root@geppetto selinux]# grep cobbler /var/log/audit/audit.log |
> audit2allow
> > -M cobblerpol
> > ******************** IMPORTANT ***********************
> > To make this policy package active, execute:
> >
> > semodule -i cobblerpol.pp
> >
> > [root@geppetto selinux]# semodule -i cobblerpol.pp
> > [root@geppetto selinux]# cd /etc/ansible
> > [root@geppetto ansible]#  ./cobbler.py
> > {}
> > [root@geppetto ansible]#
> >
> > But no real difference,... like it should since it is permissive mode.
> >
> >
> >
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to ansible-project+unsubscr...@googlegroups.com.
> > To post to this group, send email to ansible-project@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <mich...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to