# Invoking copy action plugin

**URL:** <https://forum.ansible.com/t/invoking-copy-action-plugin/36318>\
**Category:** Ansible Developer\
**Created:** [February 10, 2022, 4:04pm UTC](https://forum.ansible.com/t/invoking-copy-action-plugin/36318 "2022-02-10T16:04:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yves\_baumes](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@yves\_baumes](https://forum.ansible.com/u/yves_baumes)\
**Post date:** [February 10, 2022, 4:04pm UTC](https://forum.ansible.com/t/invoking-copy-action-plugin/36318/1 "2022-02-10T16:04:02Z")

</div>

Hello,  
I’m trying to invoke the copy action plugin with a timestamp var. Here is the code:

```auto
def copy(self, task_vars):
new_task = self._task.copy()
new_task.args.update(
dict(
src="/etc/systemd/network/",
dest="/etc/systemd/network_backup_{{ timestamp }}",
remote_src=True,
),
)
print(f"new_task={new_task}")
copy_action = self._shared_loader_obj.action_loader.get('copy',
task=new_task,
connection=self._connection,
play_context=self._play_context,
loader=self._loader,
templar=self._templar,
shared_loader_obj=self._shared_loader_obj)
ret = dict()
task_vars.update(dict(timestamp="foo"))
ret.update(copy_action.run(task_vars=task_vars))
print(f"copy action ret = {ret}")

```

I would like the var `timestamp` to be replaced with foo. Is possible with ansible vars? Or do I need to perform the lookup/replace by hand?

Regards  
Yves
