Has anyone used the community.general.facter module?

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