--- - name: Create custom facts directory file: state: directory path: "{{ global_ansible_facts_directory }}" owner: root group: root mode: "u=rwx,g=rx,o=rx" - name: Store custom apt fact copy: content: | #!/bin/sh echo "{\"architecture\": \"$(dpkg --print-architecture)\"}"; dest: "{{ global_ansible_facts_directory }}/dpkg.fact" owner: root group: root mode: "u=rwx,g=rx,o=rx" notify: reload facts