Extend setup module

70 views
Skip to first unread message

Mike Fennemore

unread,
Sep 13, 2016, 5:14:40 AM9/13/16
to Ansible Project
We have a internal CMDB that gathers facts from systems using the setup module on playbook execution. Is there a way to extend the setup module to include extra information?
From what I have read the local facts would work for Linux systems but the path wouldn't exist on Windows systems.

Mike Fennemore

unread,
Sep 13, 2016, 6:54:35 AM9/13/16
to Ansible Project
Nevermind, to answer my own question http://docs.ansible.com/ansible/developing_modules.html#module-provided-facts . Although this does add the hassle of adding a custom module to playbooks.
It would be nice to have a hook to add a module to run on playbook execution like the setup module though.

Brian Coca

unread,
Sep 13, 2016, 9:34:59 AM9/13/16
to ansible...@googlegroups.com
You might want to weigh in on this proposal https://github.com/ansible/proposals/issues/17


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

lavatar

unread,
Sep 13, 2016, 1:00:46 PM9/13/16
to Mike Fennemore, Ansible Project


------------------ 原始邮件 ------------------
发件人: Mike Fennemore <mike.fe...@sentia.com>
发送时间: 2016年9月13日 18:54
收件人: Ansible Project <ansible...@googlegroups.com>
主题: [ansible-project] Re: Extend setup module
--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7eb4f242-dcd1-4f9a-8152-6a2f088775a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Davis

unread,
Sep 15, 2016, 11:18:14 AM9/15/16
to Ansible Project
Local facts for Windows have been available since 2.1- you just need to set fact_path to tell it where on the target system to find a directory of .ps1 scripts to execute. It currently expects to find a dictionary/array on the output pipeline from each script that gets grafted onto a new fact named ansible_(factsfilename-sans-extension). 
Reply all
Reply to author
Forward
0 new messages