# Modify registered variable content from the copy module?

**URL:** <https://forum.ansible.com/t/modify-registered-variable-content-from-the-copy-module/23142>\
**Category:** Ansible Project\
**Created:** [November 30, 2016, 10:29pm UTC](https://forum.ansible.com/t/modify-registered-variable-content-from-the-copy-module/23142 "2016-11-30T22:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![burns498](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@burns498](https://forum.ansible.com/u/burns498)\
**Post date:** [November 30, 2016, 10:29pm UTC](https://forum.ansible.com/t/modify-registered-variable-content-from-the-copy-module/23142/1 "2016-11-30T22:29:07Z")

</div>

Hello -

Is there a way to modify the content of a registered variable? I have a shared role that logs output of my deployments.

**tasks/main.yml**  
`

- name: Log {{ filename }} changes  
blockinfile:  
dest: “{{ log\_dir }}/{{ pb\_logname }}”  
content: |

---

<div class="post-metadata">

**Author:** ![Alexander\_H\_Laughlin](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexander\_H\_Laughlin](https://forum.ansible.com/u/Alexander_H_Laughlin)\
**Post date:** [December 1, 2016, 12:40am UTC](https://forum.ansible.com/t/modify-registered-variable-content-from-the-copy-module/23142/2 "2016-12-01T00:40:09Z")

</div>

The only way I’ve been able to do something like this, assuming I understand correctly, is to write the value to a vars file in the playbook, then load that vars file when you need it later on in the playbook.
