From 835752cc536e8f96561d5008540045c0d79bee3c Mon Sep 17 00:00:00 2001 From: Jens Heinrich <59469646+JensHeinrich@users.noreply.github.com> Date: Fri, 9 Oct 2020 17:44:27 +0200 Subject: [PATCH] Update playbooks_vars_facts.rst (#72150) Remove misleading typo, add a note on the mode of local facts Co-authored-by: JensHeinrich --- docs/docsite/rst/user_guide/playbooks_vars_facts.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docsite/rst/user_guide/playbooks_vars_facts.rst b/docs/docsite/rst/user_guide/playbooks_vars_facts.rst index 3828b8e3ddb..8f94c4d5d20 100644 --- a/docs/docsite/rst/user_guide/playbooks_vars_facts.rst +++ b/docs/docsite/rst/user_guide/playbooks_vars_facts.rst @@ -541,12 +541,14 @@ You can add static custom facts by adding static files to facts.d, or add dynami To use facts.d, create an ``/etc/ansible/facts.d`` directory on the remote host or hosts. If you prefer a different directory, create it and specify it using the ``fact_path`` play keyword. Add files to the directory to supply your custom facts. All file names must end with ``.fact``. The files can be JSON, INI, or executable files returning JSON. -To add static facts, simply add a file with the ``.facts`` extension. For example, create ``/etc/ansible/facts.d/preferences.fact`` with this content:: +To add static facts, simply add a file with the ``.fact`` extension. For example, create ``/etc/ansible/facts.d/preferences.fact`` with this content:: [general] asdf=1 bar=2 +.. note:: Make sure the file is not executable as this will break the ``ansible.builtin.setup`` module. + The next time fact gathering runs, your facts will include a hash variable fact named ``general`` with ``asdf`` and ``bar`` as members. To validate this, run the following:: ansible -m ansible.builtin.setup -a "filter=ansible_local"