how to insert Ansible inventory out put (i.e kernel info) into database ?

66 views
Skip to first unread message

F

unread,
Mar 29, 2017, 10:59:53 AM3/29/17
to Ansible Project
Hi All,
I am very new to Ansible, currently i am trying to evaluate ansible.
i know by using ansible inventory command i can get all information about a system, like ( kernel,Os,network,memory)
but i wanted to insert those information into mysql Database.

i know its possible, but I am looking for some example to see how it can be done. (possible with ansible + python )

can any one please help me with this ?  i am looking for some sample module or documentation for this so that i can follow it.

Thanks for the help

Brian Coca

unread,
Mar 30, 2017, 1:08:41 AM3/30/17
to Ansible Project
Easiest way is using a cache plugin, there are memcached and redis
ones as examples.


----------
Brian Coca

F

unread,
Mar 30, 2017, 9:27:07 PM3/30/17
to Ansible Project
Hi Brian, 

Thanks for the reply,
would you be able to help me to understand bit more..

how will it insert  to database ?
Thanks for the help  

F

unread,
Mar 30, 2017, 9:35:39 PM3/30/17
to Ansible Project
Hi Brian,
from google, i find ansible memcache role plugin, but that seems to create memcached in server.

can you please point out which plugin you are refering ? also how will it help to insert into database ? 

Thanks for the help

Brian Coca

unread,
Mar 31, 2017, 12:16:16 AM3/31/17
to Ansible Project
What you were looking at were modules, here is where the cache plugins live:
https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/cache


----------
Brian Coca

Fosiul Alam

unread,
Mar 31, 2017, 2:32:38 AM3/31/17
to ansible...@googlegroups.com
Hi Brian,
Thanks, i looked at that module, but still dont understand, how are you inserting data in to a backed database ? 

example :-
will provide hardware information, but i want to add those into into database for inventory or audit, 
how will i accomplish this ?

I just need a basic example of how i can achieve this to understand the bigger picture.

Thanks for the help.





----------
Brian Coca

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/SY2xqJmjmO8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7cUYjGm1ZLbYZ%2BVF-nuP-5LHQV9XXcRJD%3D5xt6TsQcBEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Fosiul Alam

Brian Coca

unread,
Mar 31, 2017, 10:39:18 AM3/31/17
to Ansible Project
in the case of facts, this happens automatically via cache plugin
(when enabled), if using a specific module that does not return facts,
you have to update the database yourself.


----------
Brian Coca

Fosiul Alam

unread,
Apr 1, 2017, 6:29:23 AM4/1/17
to ansible...@googlegroups.com
Hi Brian

as you can see i am very new, would you be able to give some example how thats work, i am still looking for some module where the out put will be inserted into database.

can you please help me with this ?



----------
Brian Coca

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/SY2xqJmjmO8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards
Fosiul Alam

Message has been deleted

Mike Fennemore

unread,
Apr 1, 2017, 2:17:01 PM4/1/17
to Ansible Project
There is also ara available on pypi that has some modules to write to mysql and also gives some useful reporting abilities.

Larry Smith

unread,
Apr 2, 2017, 12:34:20 AM4/2/17
to Ansible Project
Reply all
Reply to author
Forward
0 new messages