Fixed that by setting the fact to not executable and the playbook runs fine
My second question is how to drill into the fact to reference each fact separately if i need to ?
I cant seem to drill in any further than - debug: msg="Custom facts are {{ansible_local.preference}}
Fixed that by setting the fact to not executable and the playbook runs fine
This is as expected.
If a file is executable Ansible will try to run the file, and it need to a valid program/script.
When the file is not an executable Ansible will read it content.
My second question is how to drill into the fact to reference each fact
separately if i need to ?
I cant seem to drill in any further than - debug: msg="Custom facts are
{{ansible_local.preference}}
Playbook
---
- hosts: localhost
gather_facts: on
tasks:
- name: Display custom facts
debug: msg="Custom facts are {{ansible_local.preference.new facts}}"
The space is causing the the problem.
To make it work with space you would need to use square brackets and not the dot notation.