necessário para usar isso (alterado para copy
como sugerido por @Michael Hampton):
---
- hosts: all
tasks:
- name: "Create custom fact directory"
file:
path: "/etc/ansible/facts.d"
state: "directory"
- name: "Insert custom fact file"
copy:
content: "#!/bin/bash\necho {\\"ansible_LAN_hostname\\" : \\"{{ inventory_hostname }}\\"}"
dest: /etc/ansible/facts.d/lan_hostname.fact
owner: root
group: sysadmin
mode: 0775