i am collecting some output from ansible_facts and writing them to a file on remote server with the help of copy module (content and dest)
i need to write as NONE if some item is not available on server (say disk sdb is not present on server). How can i write NONE if disk sdb is not found
my playbook is as below
- copy:
content: |
Memory = {{ ansible_memtotal_mb }}
Size of disk sda = {{ ansible_devices.sda.size }}
dest: /tmp/test
but if disk sdb is not available on server how to check and write custom message like below
Size of disk sdb = NONE