# Today's development commits -- 3 interesting things to review and test

**URL:** <https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437>\
**Category:** Ansible Project\
**Created:** [April 24, 2012, 2:09am UTC](https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437 "2012-04-24T02:09:56Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [April 24, 2012, 2:09am UTC](https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437/1 "2012-04-24T02:09:56Z")

</div>

Today we have three VERY interesting pull requests, which I have  
merged into the development branch. All 3 need  
your help testing! I said this project is moving fast right? This  
is a GREAT example. The pace at which things happen  
here is blowing me away, so thanks a tremendous amount for making this possible.

Anyway, without further ado, here's today's developments:

(1)

Jeroen Hoekx brings us a nice patch to allow any module to contribute  
facts. The setup module will still be called automatically by the  
playbook, but if you want facter facts and ohai facts to be accessible  
as variables you will need to do the following:

tasks:  
&nbsp;&nbsp;&nbsp;- action: ohai  
&nbsp;&nbsp;&nbsp;- action: facter

Otherwise, for performance reasons, they will NOT be called. This is  
made possible by the fact that we have Ansible facts now (sfromm's  
very nice patch) so I hope this is not controversial. If you are  
using 0.3 and want to future proof yourself now so you don't forget,  
you can go ahead and add the "action: ohai/facter" steps, and it won't  
do much, but it won't hurt you now. I strongly believe we won't need  
any non-Ansible facts and folks should look at switching over. I have  
a 0.3 doc item to include the list of stock facts on the web page.

We'll need to include this docs and mention it requires 0.4

[https://github.com/ansible/ansible/pull/209](https://github.com/ansible/ansible/pull/209)

Since this is kind of a playbook API break (a very very minor one),  
thoughts on this are welcome. Do you think setup should still call  
ohai and facter modules automatically if installed, or not?

---

<div class="post-metadata">

**Author:** ![Jeroen\_Hoekx](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeroen\_Hoekx](https://forum.ansible.com/u/Jeroen_Hoekx)\
**Post date:** [April 24, 2012, 2:40pm UTC](https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437/2 "2012-04-24T14:40:14Z")

</div>

Hi,

Some clarifications:

> Jeroen Hoekx brings us a nice patch to allow any module to contribute  
> facts. The setup module will still be called automatically by the  
> playbook, but if you want facter facts and ohai facts to be accessible  
> as variables you will need to do the following:
> 
> tasks:  
> - action: ohai  
> - action: facter
> 
> Otherwise, for performance reasons, they will NOT be called. This is  
> made possible by the fact that we have Ansible facts now (sfromm's  
> very nice patch) so I hope this is not controversial. If you are  
> using 0.3 and want to future proof yourself now so you don't forget,  
> you can go ahead and add the "action: ohai/facter" steps, and it won't  
> do much, but it won't hurt you now. I strongly believe we won't need  
> any non-Ansible facts and folks should look at switching over. I have  
> a 0.3 doc item to include the list of stock facts on the web page.

The ohai and facter modules already existed before. I just changed  
them to use the new json return layout. But we should probably rewrite  
them to use the same variable naming conventions as used in the setup  
module (prefix with facter\_ or ohai\_).

Ohai and facter are currently still run in the setup module if they  
are on the system. So you don't have to add them to the playbook.

Greetings,

Jeroen

---

<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:** [April 24, 2012, 2:43pm UTC](https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437/3 "2012-04-24T14:43:35Z")

</div>

> Hi,
> 
> Some clarifications:
> 
> > Jeroen Hoekx brings us a nice patch to allow any module to contribute  
> > facts. The setup module will still be called automatically by the  
> > playbook, but if you want facter facts and ohai facts to be accessible  
> > as variables you will need to do the following:
> > 
> > tasks:
> > 
> > - action: ohai
> > - action: facter
> > 
> > Otherwise, for performance reasons, they will NOT be called. This is  
> > made possible by the fact that we have Ansible facts now (sfromm’s  
> > very nice patch) so I hope this is not controversial. If you are  
> > using 0.3 and want to future proof yourself now so you don’t forget,  
> > you can go ahead and add the “action: ohai/facter” steps, and it won’t  
> > do much, but it won’t hurt you now. I strongly believe we won’t need  
> > any non-Ansible facts and folks should look at switching over. I have  
> > a 0.3 doc item to include the list of stock facts on the web page.
> 
> The ohai and facter modules already existed before. I just changed  
> them to use the new json return layout. But we should probably rewrite  
> them to use the same variable naming conventions as used in the setup  
> module (prefix with facter\_ or ohai\_).

Hmm, so the new layout is to wrap them in “ansible\_facts” as a dictionary? This seems unnecessary if the setup module is going to call them.

I doubt anyone is using them via the API but we should not change data structures if we can avoid it.

Maybe explain more about this?

> Ohai and facter are currently still run in the setup module if they  
> are on the system. So you don’t have to add them to the playbook.

Very good!

---

<div class="post-metadata">

**Author:** ![Jeroen\_Hoekx](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeroen\_Hoekx](https://forum.ansible.com/u/Jeroen_Hoekx)\
**Post date:** [April 24, 2012, 2:53pm UTC](https://forum.ansible.com/t/todays-development-commits-3-interesting-things-to-review-and-test/11437/4 "2012-04-24T14:53:25Z")

</div>

> > The ohai and facter modules already existed before. I just changed  
> > them to use the new json return layout. But we should probably rewrite  
> > them to use the same variable naming conventions as used in the setup  
> > module (prefix with facter\_ or ohai\_).
> 
> Hmm, so the new layout is to wrap them in "ansible\_facts" as a dictionary?  
> This seems unnecessary if the setup module is going to call them.

That's correct. The setup module doesn't use these modules.

> I doubt anyone is using them via the API but we should not change data  
> structures if we can avoid it.
> 
> Maybe explain more about this?

Thinking about it, wrapping these modules is probably unnecessary. I  
will send in a patch to revert the changes to the ohai and facter  
modules.

Jeroen
