# Has anyone used the community.general.facter module?

**URL:** <https://forum.ansible.com/t/has-anyone-used-the-community-general-facter-module/36458>\
**Category:** Ansible Project\
**Created:** [March 18, 2022, 5:01pm UTC](https://forum.ansible.com/t/has-anyone-used-the-community-general-facter-module/36458 "2022-03-18T17:01:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goran](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Goran](https://forum.ansible.com/u/Goran)\
**Post date:** [March 18, 2022, 5:01pm UTC](https://forum.ansible.com/t/has-anyone-used-the-community-general-facter-module/36458/1 "2022-03-18T17:01:07Z")

</div>

I’m trying to access Puppet custom facts from a ansible playbook…

But I’m out of my depth when it comes to decoding the JSON…  
Has anyone worked with the facter module and got some example to help me on my way?

**Something like this…?**

- name: Get Puppet facts  
community.general.facter:

arguments:

- -p

- my\_fact  
register: facts _← register output I guess?_

- set\_fact:

my\_fact={{ facts.json | json\_query(‘my\_fact’) }} ??

- name Use fact to decide when to upgrade with apt…

apt:

…  
when: “{{ my\_fact }}” == true ??

Kind regards,  
Goran
