Since you have at least one working and one failing machine (presumably of 
the same OS version), can you compare the "rpm -qa" output and see what's 
different between the two just in case it's a simple package that was 
missing?

On Sunday, June 16, 2019 at 2:10:04 PM UTC-5, Thomas Spear wrote:
>
> Hi all,
>
> I have an environment setup where we have puppet applying configuration 
> management, and ansible is used to make approved one-off changes.
>
> As part of a playbook, we pull the facter_installed_rpms fact into a 
> variable within the play and check for the presence of a given RPM. This is 
> simpler than using the command module to do rpm -qa, and practically the 
> only way to do this since the rpm module doesn't seem to provide an option 
> to query installed modules without making a change.
>
> In the majority of our hosts, this works fine without issues.
> But in a few servers, I'm getting an error from ansible that 
> "facter_installed_rpms" is undefined.
> Additionally, when I run "ansible localhost -m setup -a 
> 'gather_subset=!all,!any,facter' " I'm unable to see any facter_* facts in 
> the output, and as such, ansible fails when this fact is not defined.
> Whereas on the working host, the above command shows facter_* facts (as 
> documented by the setup module's documentation page)
>
> Notes 
> <https://docs.ansible.com/ansible/latest/modules/setup_module.html#id3> 
> <https://docs.ansible.com/ansible/latest/modules/setup_module.html#notes>
>
> Note
>
>    - More ansible facts will be added with successive releases. If 
>    *facter* or *ohai* are installed, variables from these programs will 
>    also be snapshotted into the JSON file for usage in templating. These 
>    variables are prefixed with facter_ and ohai_ so it’s easy to tell 
>    their source. All variables are bubbled up to the caller. Using the 
> ansible 
>    facts and choosing to not install *facter* and *ohai* means you can 
>    avoid Ruby-dependencies on your remote systems. (See also facter 
>    
> <https://docs.ansible.com/ansible/latest/modules/facter_module.html#facter-module>
>     and ohai 
>    
> <https://docs.ansible.com/ansible/latest/modules/ohai_module.html#ohai-module>
>    .)
>
>
> I have narrowed this down to the point where I'm fairly confident that its 
> something in the puppet configuration being sent from the puppet compile 
> masters, rather than the ansible configuration.
>
> The working hosts connect to one set of compile masters while the 
> non-working hosts connect to another different set of compile masters. So I 
> think something in the code (or maybe in the system environment as a result 
> of the puppet code) between the two sets of compile masters is different, 
> but I haven't the faintest idea what it might be.
>
> That being said, I am hoping that I can do some additional probing of the 
> ansible setup module to find out what is different so I can identify the 
> root cause for this discrepancy, but I'm not sure what all I should try.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/239c4f99-8d5a-42c5-b88a-c19d208bd73e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to