# how to modify output

**URL:** <https://forum.ansible.com/t/how-to-modify-output/30114>\
**Category:** Ansible Project\
**Created:** [April 15, 2019, 7:20pm UTC](https://forum.ansible.com/t/how-to-modify-output/30114 "2019-04-15T19:20:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmontaldo3](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@fmontaldo3](https://forum.ansible.com/u/fmontaldo3)\
**Post date:** [April 15, 2019, 7:20pm UTC](https://forum.ansible.com/t/how-to-modify-output/30114/1 "2019-04-15T19:20:05Z")

</div>

Hi folks:

I got the following playbook

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 16, 2019, 1:56am UTC](https://forum.ansible.com/t/how-to-modify-output/30114/2 "2019-04-16T01:56:12Z")

</div>

Hi

> Hi folks:
> 
> I got the following playbook
> 
> * * *
> 
> - hosts: win-ravendb-prd  
> tasks:
> 
> - name: Get disk facts  
> win\_disk\_facts:
> 
> - name: Ip address  
> debug:  
> var: ansible\_ip\_addresses
> 
> - name: Grab first disk  
> set\_fact:  
> disk: ‘{{ ansible\_facts.disks|selectattr(“system\_disk”)|first }}’
> 
> - name: Set disk size  
> set\_fact:  
> disksize\_gb\_human: ‘{{ disk.size|filesizeformat(True) }}’
> 
> - local\_action:  
> module: copy  
> content: “{{ disksize\_gb\_human }}”  
> dest: /tmp/“{{ ansible\_ip\_addresses | to\_nice\_json }}”

You’re creating files here with a name that’s json? That’s unusual.

> As an output is shows the following:
> 
> -rw-r–r-- 1 root root 8 abr 15 15:18 “[? “10.33.80.189”?]”  
> -rw-r–r-- 1 root root 8 abr 15 15:18 “[? “10.33.80.187”?]”  
> -rw-r–r-- 1 root root 8 abr 15 15:18 “[? “10.33.80.186”?]”  
> -rw-r–r-- 1 root root 8 abr 15 15:18 “[? “10.33.80.188”?]”

That’s what you told it to do. The ? Is probably due to the json structure not entirely shown or created as file name.

> There is a way to parce the information in order to output without "[?

If you want the files to be named as the IP address (which is an assumption) then tell the copy command to do that, possible using a useful extension, for instance:

dest: “/tmp/{{ ansible\_default\_ipv4.address }}.txt”

Dick
